As the blockchain is downloaded and scanned, the wallet file is updated to essentially indicate which block it is synced up to.
For instance, let's say that your node is fully synced, and pruned so it currently has block data from 695816 to 697816. Wallet #1 was open during download/sync, so it has been synced all the way from 0 to 697816.
Wallet#2 was not synced, so is effectively only synced to block 0... so, when you open wallet#2... the node is "missing" 695815 blocks... they cannot be scanned to see if any transactions in those blocks involve addresses in wallet#2.
So, the only way to check these blocks is to redownload them. This is why you get the error message that says:
"bitcoin closing the wallet for too long can result in having to resync the entire chain if pruning is enabled"
If you close a wallet and pruning is enabled... it's warning you that if the wallet sync point ends up outside of the range of blocks on disk... the node will end up having to redownload the entire chain again to sync that wallet.
The solution? Open both wallets
at the same time when syncing the node, as Bitcoin Core supports having multiple wallet files "open". That way, both will be updated simultaneously.
Then, either leave them both open
all the time... or make sure you are regularly opening/syncing both wallets to ensure they don't fall out of the block range stored on disk.