I am not certain, this is a bug, but the compiler thinks so, hence this post.
Actual behavior
With the following code:
@startuml
hide empty description
state state1.idle as "This is the idle state"
state state1.over
state1.idle --> state1.over
@enduml
I get the correct result (the display name of the state state1.idle is changed):

However with the following code:
@startuml
hide empty description
state state1 as "Toplevel state"
state state1.idle as "This is the idle state"
state state1.over
state1.idle --> state1.over
@enduml
I get the following exception:

Expected behavior
I would expect the result to be akin to the following:
@startuml
hide empty description
state state1 as "Toplevel state" {
state idle as "This is the idle state"
state over
idle --> over
}
@enduml
I am not entirely sure this is a bug, this may very well be misuse of the namespace syntax.