So, the issue here is that your $Sprite reference isn’t working - it’s null according to the error. What node is the above script associated with? For that $Sprite reference to be valid, you’d need a node named Sprite as an immediate child of the node associated with the above script. Apparently, that’s not the case here.
An immediate child, you say… it’s a grand-grand-child, so perhaps that’s the issue? For some reason I thought that any children down the branch would be “found automatically” in such a situation.
EDIT:
I think I know my mistake now: following the variable scope I shouldn’t put my var a_random_number into the func _ready(): (or any function really) because the value would be erased immediately after the reday-script finishes, thus leading to the null-instance. Putting the variable “on top of the script” should keep the value available.