I tape new box to batten of wood.
Tape the wood batten to the wall either side.
The box is now floating in the hole but dead level with wall surface.
Bang some filler behind and wait for it to set.
Then a bit of filler around edges. Wait for it to set
Remove batten.
Now fill and tidy around.
I often don't bother with screw through back box. Filler will hold.
Start trying to nail it will get box bent up.
Why do you need tape?