This is relevant to the Blueprint Sandboxes mod (https://mods.factorio.com/mod/blueprint-sandboxes)
Steps to reproduce:
1) Blueprint Sandboxes >= 1.6.0
1) Place a searchlight inside a blueprint sandbox surface
2) Clear the surface without removing the searchlight manually
I've encountered a similar problem before with the Stack Combinators mod, relevant thread:
https://mods.factorio.com/mod/blueprint-sandboxes/discussion/625a411f1e0ae975b98973a1
Error text:
The mod ⚠️ SearchlightAssault ⚠️ (2.1.1) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event SearchlightAssault::on_entity_destroyed (ID 158)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
[C]: in function 'index'
__SearchlightAssault/control-tunion.lua:472: in function 'GestaltRemoved'
SearchlightAssault/control-gestalt.lua:464: in function 'SearchlightRemoved'
SearchlightAssault/control.lua:467: in function <SearchlightAssault/control.lua:465>