Exploding objects will create new AutoCAD objects, after that you need to erase the original objects.
Erasing objects will affect the existence of others, if you immediately erase an Alignment after exploding, all Profiles and Profile Views and Sections etc will be deleted too.
So you better explode all object first, then erase all original objects inside a try-catch.
Or, send a Command Line string: "Explode all".