On my system, the command
produces a segmentation fault if i = 1, but not otherwise.
The fold and atom tree machinery are MUCH better at adding things than deleting them; usually one throws out the pose when you're done with it rather than try trimming it.
Look into the conformation object instead of the pose object (pose.conformation()). It should have a bunch of things like delete_residue_slow which are probably smarter and can handle deleting the root of the atom tree.