It can be useful to completely remove a transaction from a wallet rather than just abandon it. See e.g. #26667.
The original -zapwallettxes
startup option was removed in #19671. It was perhaps overkill, but a simple zaptransaction
RPC would be nice.