When I run the program you posted first, I'm unable to see anything wrong.
Here are prints of comp.pos and comp.axis for each of the three positions, which make sense:
<0.5, 0.5, 0.5> <1, 0, 0>
<0.5, 2.5, 0.5> <6.12323e-17, -1, 0>
<2.5, 2.5, 2.5> <-6.12323e-17, -1, -7.4988e-33>
In the final position the green quad is in the xy plane and the fold line is vertical.
The orange quad is on the right, in the xz plane. All of this looks correct.
Can you describe in more detail what you see? I inserted scene.pause() after
each step. I never see the configurations that are in the image you posted, which
perhaps did not come from the code you posted first?
Bruce