Enable multi-line register display with Ctrl+T. That should let you see the transfer account in the bottom part of the Quantity box. If it is going somewhere other than the associated Cash account, change it. Expect Money to remember.
If you don't see the TransferTo field, make sure that TrackCashTransactions is selected in the account settings.
If the cash account disappeared, you could export a QIF file from the Investment register. Edit that QIF file to remove older transactions to a avoid duplicates. Restore a backup from before when the problem started. Import the edited QIF as a recovered
account.