[DF-2088] Fixed removing of inner objects of switch entity. Fixed crash with adding of switch entity