See test plan for build steps.
Before patch with BUILD_BITCOIN_WALLET=OFF:
[339/345] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/rpcconsole.cpp.o ../src/qt/rpcconsole.cpp:1055:22: warning: unused variable 'wallet_model' [-Wunused-variable] WalletModel *wallet_model{nullptr}; ^ 1 warning generated.
After patch: no warning present
This is a small deviation from Core, but even their latest code does not deviate in its use of wallet_model
in this function. The maintenance overhead should be minimal.