Avoid walking into a rectangle
JavaScript (ES6),  66  57 bytes
Expects (Sx,Sy,Ex,Ey,[Tx,Ty],[Bx,By]). Returns 3 points.

(S,s,E,e,T,B,[x,y]=T)=&gt;[S&gt;x&amp;s&lt;y?B:T,[B[0],y],E&gt;x&amp;e&lt;y?B:T]

Try it online!
Method
The first point is \$(Bx,By)\$ if the start point is in the gray area or \$(Tx,Ty)\$ otherwise.
The second point is always \$(Bx,Ty)\$.
The third point is \$(Bx,By)\$ if the end point is in the gray area or \$(Tx,Ty)\$ otherwise.