Some stuff I don't understand, can you help me please?

Hello, this is my first time here, and I’d like to ask some questions:
Why can’t I use variables to define GUIs? I mean, I really can’t, if I use them then the script simply dies not work, I have to write the full name of each GUI segment every time I need it, this is annoying. I’d like to ask, is there a specific reason for that or is it just a bug?

Also, I’m having an issue with the thing on the image below. I’m using the same place, script and a way to reach the StarterGui, but it returns 2 different values. I mean, an error and a value… this also a bug and how can I fix this, if it’s not?!

what_the…|292x135

game.Players.PlayerGui:WaitForChild(“ScreenGui”)

like @ThoseNamesAreGood said, you should use WaitForChild.
the reason your script is erroring sometimes is that the screengui probably hasn’t loaded in yet, WaitForChild() will wait for an object to load. just typing PlayerGui.ScreenGui is the script assuming the object is there already.

As for the first question, we can’t really answer it without you giving us your code