I cannot constrain the origin of the portal when the wall rotated

Hi
I am trying to implement a portal mechanic but I struggled with placing portals on walls when I rotate the wall 90° in Y axis.
I am using the inverse transform-constrain-redo the transform approach. Theoretically it must work but I could not make it work. Can anyone help me about it?

This is my TryAddPortalOnWall method: https://blueprintue.com/render/5p7g2rp2/

This is my ConstrainPortalOnWall methoıd: https://blueprintue.com/render/c1_4xr95/

This is my ClampPortalOnWall methud: blueprintue/render/hb4zmdy8/ (I cannot put 3 links)