The problem was here:
UClass* ActorClassOutTemp = OverlappingActors[ClosestActorIndex]->GetClass();
ActorClassOUT = ActorClassOutTemp ->GetClass();
You were trying to convert UClass* to TSubclassOf
Unfortunately I don’t know how to do such thing. So, instead of this I tried to use UClass* instead (as you wanted to in the first place) and it turned out that it works normally. My bad!
I’ve fixed my answer above. The code should work properly now.