So my house has a super janky wall box. Very out of code, on an old exterior brick wall, and stupidly shallow. It has been an open hole for 3 years. Finally got an electrician out and they basically said “if you fix this, it’s gonna be a billion dollars” (which I anticipated).
Nice!
I don't know why people are suggesting mud rings; that's for something else. I've used these box extenders in a similar situation:
https://www.homedepot.com/p/Smart-Fill-Spacers-1-4-in-2-Gang-Outlet-Box-Spacer-Extender-5-Pack-DG14-5/307424565