I was on my redstone world where I did all my tests and I had just made a lava door to secure buildings in survival mode and I wanted to test there in survival mode. But there were too many Slimes on the world and so I wanted to use the blocks commands so I wouldn't have to go into peaceful mode. But I entered in the block command the following command: /kill @a[spells=nearest] . I've put this command block in "rehearsal" and so I can't MORE OF ALL go on my world without getting killed instantly.
If you setup a vanilla server and run the world there, you can change the config of the server to not enable commands blocks. That way you should be able to access the world and remove the culprit command block.
However, it may mess up some of your redstone builds, if they use command blocks. So, remember to backup your world.
It's also possible you could change to spectator mode and then remove the block with /setblock