There are two and a half options here. These are both fairly close to product recommendations, but that's what we get for a weird case like this.
Option one: if these are next to a stud, you can use a Southwire 'Smart Box'. It has diagonal screws as part of the assembly that you can drive into the adjacent stud. Even if there isn't a stud, you might be able to make one of their Shark Tooth style boxes work, depending on the full depth of the ceiling assembly.
Option two: use deep 'madison straps'. I believe these are made in a 2 inch version which should get you enough depth. This solution will work even if there is no stud. They must be used with a matching flanged box.
Option two and a half (late edit): oh yeah, you could hack away some of the material behind the wall, as given in the other answer. I don't love this answer because square cuts of drywall are much stronger than angled ones, but if it's just for junction boxes with no devices it's a fine answer too. You don't need to make room all the way around for the wings.