Even if not using "allowmixing", the following code creates a valid diagram (although it should not be possible to mix components and classes (same with object)...
So it seems to be a problem that occurs when mixing class (obj) elements with other (e.g. component) elements onto one diagram which should raise an error I guess, but renders, but then creates a problem with remove and hide...
When introducing "allowmixing" it would be valid to mix these elements, but still the problem with remove and hide remains...
@startuml
component "huhu" as huhu {
class "trara" as trara
}
remove trara
@enduml