Welcome to the forums @"K-Storm-Studio Ltd"!
If you change line 54
to the following, I believe it will work (untested):
get_tree().get_root().get_node("MainScene2D").get_node("HUD/Coins").text = str(player_data.coins)
The issue with the original code is that you are trying to access a child node using a property get_node("HUD").coins
rather than getting the child node from the HUD node: get_node("HUD/Coins")
or get_node("HUD").get_node("Coins")
.