Further experimentation triggered a similar issue when rotating certain belts:
The mod Stargate (0.1.4) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event stargate::on_robot_mined_entity (ID 65)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
[C]: in function 'index'
__stargate/control.lua:177: in function 'OnDestroyBelt'
stargate/control.lua:214: in function '?'
stargate/lib/lib_control_cache.lua:151: in function 'call_ents'
stargate/lib/lib_control_cache.lua:399: in function 'y'
stargate/lib/lib_control.lua:287: in function <stargate/lib/lib_control.lua:287>
I found there's a particular set of 16 locations where these can come up, arranged around a 4x4 region. They happen when a belt ichange happens that either starts or stops pointing into or out of that region. This felt like something a stargate would use to detect belts connecting/disconnecting from it.
I tried placing a new stargate in the 4x4 region, then mining it out by hand, and after that those locations no longer triggered the error. My current speculation that I did something that caused a stargate to be removed without un-registering some event listeners meant to capture belt connection changes, and then when the event listeners fired they sent messages to Lua's equivalent of a dangling pointer.
I've got mod-free (except Stargate) savegame in which this behavior can be easily triggered, if that would be helpful.