I tried the phases method myself and it works great for cuboid openings of the wall. But not for yours because…? Bugs?
Here’s what I did:
New Temporary phase:
Dynamo looking like this:
And effectively the sockets were put in the future phase. Revit handles that with filling the wall’s void with new solids:
And in Revit they look ok. So you would imagine that joining them with the rest of the wall is all that you need now, but:
In Dynamo these solids look differently