I get the same problem in the same situation. Using upgrade planner the direction of the miniloader changes, and when trying to rotate it, it gives a similar error. The upgrade was from Fast (red) --> Ultimate (Green), in Bob's Logistics.
The mod Miniloader (1.14.2) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event miniloader::on_player_rotated_entity (ID 20)
miniloader/control.lua:155: attempt to index local 'miniloader' (a nil value)
stack traceback:
miniloader/control.lua:155: in function 'handler'
miniloader/lualib/event.lua:15: in function <miniloader/lualib/event.lua:13>