Can not access game object added in overlay scene
You can not use a variable for KX_GameObject that contains characters like ".", ",", "!" etc. You must use only lowercase and uppercase letters and numbers. In this case you must do something like:

HUDtext = hud.ojects["HUD.text"]


or

HUD_text = hud.objects["HUD.text"]


You can use any variable name that contains only letters and numbers. Note that it can't start with number.