Why do I need to cast to one actor after getting it from a class but not the other?

i notice you need to compile, always do that after adding components or variables as it often fixes issues like that, may not this one but its good practice.