Easiest to just install an AB switch on the hot side instead of a breaker or in addition to.
My RV-type breaker box has two main inputs (shore and generator). The breakers are next to each other and there is a physical plate that when one breaker is turned to ON then the other breaker gets turned to OFF. This is a very good 20 cents solution, and came from an old old RV. I dont have a link to give, but the solution is a breaker or switch that can only be set to one input or the other. Usually done on the hot wire, well, all breakers are...
Yes, if you back-feed an ordinary inverter you will smoke it. This is nothing like DC power where you can backfeed it, with AC you cannot.
On that same wire system I added an inverter, so had shore, generator and inverter. On the outlet wires only I added an A/B toggle switch (selects either A or B) and put it on the hot wire from the breaker box. This now selected either inverter or breaker box (shore or generator), and the main circuit breaker still selects generator or shore by separate operation. The inverter was to only be used on outlets, not the air cond and not the heating element on the propane fridge, so this solved how to cut out those two from the inverter without messing with shore or generator. This made it impossible to select two power sources at the breaker box - all 3 could be hot, but only one selected to feed the box, and one selected to feed the outlets.
So, the generator or the shore could be powering the box therefore the air cond and fridge but the toggle isolated the outlets.
How up to code it was putting a toggle switch in IDK, but Im sure there are methods to make it code, and more sure there are devices made to do this that are code. There is no code for me wiring up my RV that I have to follow legally, but I still kept it safe.
So, with inverter running the electric the DC operation of the fridge stayed on DC. Fridge was not on the "outlets", it was on a breaker in the box.. that fed its own outlet separate. The fridge would auto switch to AC if power is present. Fridge uses way too much power on AC mode, so never run that off battery.