I'm afraid it's completely random (seemingly at least) sometimes it works great - sometimes don't 😔
one solution is to set your original wall to have the 'noexport' texture and make another room next to it in a different BSP group (with it's wall facing inwards also 'noexport')
in other words when the BSP fails there is no other choice but do a little manual carving (at least to glue two groups together)