Tested on r6646 pak64
How to reproduce:
1. Load the attached savegame.
2. Build 'Big modern terminal' at (13, 25).
Result:
The terminal will be build apart from original stop.
A part of the terminal will be build on different height.
(http://i.imgur.com/87hQEHV.gif)
Without looking a the code, it looks like the game wants to position the terminal from cursor position towards lower right, which is what it would do if the slope isn't there. It correctly detects that that won't work. It may then calculate the correct new corner if it were to rotate the terminal 90 degrees, but forget to actually build the terminal with the new rotation.
Stepping through wkz_station_building_aux, I see that rotation is set to 2, but offset is set to 0,3. As I understand it, an offset of 0,3 is only suitable for rotation 1 and 3. I'm suspecting the massive changes i r6621.
Indeed, an unbelievably simple mistake - I even commented this section correctly then proceeded to type the wrong code! Fixed in 6654.