Move connected wall

Hey Guys
im trying to move part of my wall as seen in the photo

But by just moving it (Element.SetLocation) the connection gets lost. So i tried creating a wall in between the gap. But the Connection between the walls stops making any sense as seen in the photo.

My Script looks like this

Can you tell me what im doing wrong? Or do i even need to create a wall. Because i cant move it upwards without losing connection.

Please refrain from duplicating topics. It clutters the board and makes it harder to help you. Closing this topic accordingly.