Depends on #27601.
Adding test coverage and the needed checks for two scenarios where the wallet create invalid transactions.
First Scenario, Do Not Use Outputs From the Tx Being Replaced
When the wallet creates/fund a replacement transaction, it should not fund the new transaction with outputs belonging to the tx being replaced.
Reason: Once replaced, those outputs are no longer going to exist, there by the created/funded transaction will be invalid.
Second Scenario, Do Not Create BIP125 Rule 2 Invalid Txes
Prevent adding new unconfirmed outputs to the transaction being created/funded If any preset input was already spent by a mempool transaction.
Note: Both scenarios can can be verified cherry-picking the tests commits on master. They will fail.