put another structure block in your build that is triggered by an observer block facing air, the other part of the structure when loaded should delete the observer and the structure block that loaded the other part, just use this method, does not work well with rotations.
To spare people from leading the long bug report, I decided to instead create a summary and instructions here.
Summary of the Summary: Take any files and pieces of code related to and part of structure block mechanics along with dependencies, then use them for the current version. Adapt as needed try not to cause the error again.
Basically some files connected to the structure block may have some errors in calculations, the problem could also be related to the files that make the structure block work as well. Keep in mind this may affect the /structure command in command blocks.
The main part of the issue is that when a structure block is in another structure and that structure encapsulating the structure block is rotated enough times it deforms the coordinates and how rotations should happen for the structure block inside the structure.
Keep in mind that versions 1.19 and before did not have this issue and rotated structure blocks in structures along with adapting their coordinates and rotations correctly as well. The safest version to go back to is 1.18, but I recommend something in between 1.18 and 1.19 to be the fixed versions.
I had multiple people/friends test this bug across multiple platforms and conditions to make sure this was not platform related issue, or an issue limited to worlds, realms or servers, it affects all.
More info is in the main bug report.
actually this feature used to exist
thanks for fixing it