Across integration test runs we noticed that the metadata of custom entities persist even if the parent entity (if one exists) is deleted.
For know entities we individually delete its containing entities. For example application delete individually delete programs inside the application. This causes the metadata of the individual children to be deleted. Since custom sub entities are not deleted by cdap their metadata is not deleted.
The consequence of not deleting this is that when the parent entity with same name is recreated these sub entities metadata become confusing.