Similar issue (but not the exact same error) here:
The mod Belt Balancer 2 (2.0.8) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event belt-balancer-2::on_robot_built_entity (ID 14)
belt-balancer-2/objects/balancer.lua:140: attempt to index local 'stack_belt' (a nil value)
stack traceback:
belt-balancer-2/objects/balancer.lua:140: in function 'recalculate_nth_tick'
belt-balancer-2/objects/belt.lua:218: in function 'built_belt'
belt-balancer-2/control.lua:115: in function <belt-balancer-2/control.lua:94>
It seems the issue is specifically when an underground belt next to a balancer is placed/updated