
The above image holds the crash log, as well as the situation which caused it. I placed the Heat Pipe under the red circle, then the crash happened. I had been placing and replacing Underground Heat Pipes for some time, trying to clean up a design. Some may have been forcibly replaced via in-game copy/paste. There used to be an Underground Heat Pipe below, where the Heat Pipe corner intersection is in the screenshot, but I removed that shortly before.
edit
Actually, it seems like my game crashed every time I try and place an Underground Heat Pipe segment in that specific slot. This suggests I've somehow left a broken invisible piece of a previous Underground Heat Pipe somewhere that this is trying to connect to. It doesn't seem to matter which direction I face it, either. Same crash every time.
edit
Looking at control.lua line 103, it doesn't really make sense what could be crashing. It says invalid lua entity, but you're already checking old_directional_heatpipe and new_directional_heatpipe was just created. So unless LuaSurface.create_entity is somehow giving an invalid entity, the only thing I can figure is old_directional_heatpipe is somehow both not null and also not valid. It's just THAT one tile. Everything else works fine, so I suspect you're getting garbage data from surfacedata.directional_heat_pipes[key], but I'm genuinely guessing at this point.