If you save the project and then perform the Delete in Petrel the cropped realized cube is deleted. Prior to saving the project it is not deleted. I duplicated the behavior you documented by creating a plug-in using your code.
I'm not sure if it is a bug, but suspect it may be a feature. Certainly your code is not an issue.
Perhaps a more Petrel savy person will comment on the logic Petrel is using here.