PlantUML does not render correctly the nesting of states in composite states. (This problem was not present before, I cannot tell since when the problem is there.) Take the example of the following very simple statechart, containing just 2 states, and one transition between both states:
@startuml
[*] --> StateA
state StateA {
StateA --> StateB
}
state StateB {
}
@enduml
From the textual notation it is clear that StateA and StateB reside at the same level (StateA is not contained in StateB or vice versa). Still, when visualising this example, StateB will be drawn as if it appears INSIDE StateA, which is clearly not the case.


In fact, when you take exactly the same example, but you change the order in which the states appear in the plantuml description (and this order should have no effect on the visualisation, in principle), then the problem no longer appears. (Note that this is not a general solution since I have more complex examples where, regardless of the order, there is always something wrong in the visualisation...)
@startuml
[*] --> StateA
state StateB {
}
state StateA {
StateA --> StateB
}
@enduml
