Same as with a blank wallet (#28976), wallets with no legacy records (i.e. empty, non-blank, watch-only wallet) do not require to be migrated.
Steps to reproduce the issue:
1.- createwallet "empty_wo_noblank_legacy_wallet" true false "" false false
2.- migratewallet
0wallet/wallet.cpp:4071 GetDescriptorsForLegacy: Assertion `legacy_spkm' failed.
1Aborted (core dumped)