I'm not sure whether or not I got your question rifht but when I try:
@startuml
/' note does workds fine within component '/
package "Package 1" as package_1 #undefinedCOLOR {
class "Class 1" as class_1 {
note top of class_1: if you replace the component with type class - the note will break
}
}
@enduml
In the PlantUML Web Server I get :
http://www.plantuml.com/plantuml/png/JO_1QiOW48JlFiMG7d8g8TUU0haMKle2nUgcaHXNr112wRjNJNxuHL3cczsT7MAI8UsR5TVfMZXE1CqKSN1OTSHi7E4mQJ4EYZVFZbn2smdXfLhb3w7vk3zz0nbnoryzNdQdgTJhSNgVFl4hXB8oHZHZVIv_bR8xqpeyiGVF3_aDPiR9Em9vArN62ptbAC6GJa-N7w-LbpuPMOllG78Lug_SWPpEk_u3
So looks OK to me.
Which version of PlantUML are you using (PlantUML Web Server is currently 1.2018.14)?