The only thing I can think of top of my head is that the widget was created on the server side and so only the server has the variable. When you use the print statement, does it say client or server? That’ll usually tell you on which side the variable is on, server or client. So if it on server then it can only be called on server. If it on client then only the client can have access with it. Even if it was replicated.
Just find out what side the variable was set and then call it from that side.