Hiya,
I had a very similar problem just now and figured it out. I think Micheal is right. You do not define “msg” this variable properly, so Pavlovia is not able to read it and present “Hello World”. Perhaps it seems that you defined, but somehow the order of your codes or putting it into wrong tabs makes Pavlovia think you don’t define “msg”.
The thread below also inspires me. Hope it helps.