You cannot spent the bonus action on an offhand attack if the opponent is already dead. There is literally nothing to attack. No P&P round would actually demand that you lose your bonus action in this situation.

That you have to toggle dualwielding on and off all the time in BG3 is one of the inconveniences of the interface.