Well the “Get All Actors of Class” searches for all actors within the level. To find a gamemode blueprint there should be fairly hard so the for loop doesn’t have anything to go through.
I am fairly confused by the first way you tried to do this though since from what I see it should work.
You could try using Blueprint Interfaces. They are the second way to get a variable from BP A to BP B.
In the HUD blueprint should also be a node called “Get owning X” I’m not 100% sure if there is a gamemode node of those or if that’s only for the controller and character.