Duplicate mod - there already exists "No Respawn Gun SpaceAge"
https://mods.factorio.com/mod/NoRespawnGun-SpaceAge
No need to make a new mod (especially if you're not even sure how it works because of vibe coding) if the function already exists.
You could also use HardcoreStart: https://mods.factorio.com/mod/HardcoreStart
There are many more other duplicate mods on the forum too, so what? It works, pistol doesn't appear on respawn. If people find this version of mod and not the different one, but still have what they wanted, so what's the problem then?