Blueprint inheritance from C++ not

Hi All,
I’m having an odd issue with one of my Blueprint callable C++ functions. The C++ code is as follows:

// Spawn new battle unit on the battlefield at the selected spawn location
UFUNCTION(BlueprintCallable, Category = "SpawnActor")
void SpawnUnit(UPARAM() TSubclassOf<class ABattleUnitBase> UnitType, FVector const& SpawnLocation);

Essentially I have a unit manager class, which holds a pointer to all spawned units on the map. I want to specify which BP variation of my base unit class I’d like to spawn, because I would like to extend all customisation of the C++ base class to BP. Now the problem is that even though both BP classes inherit from the same C++ base class, the object that always gets spawned is the white one. I tripple checked the class defaults of both BP classes, they both inherit from the same C++ base class. I would appreciate any feedback or suggestions! Thank you.

This ended up being a bug. I made a few changes to my code in MSVS (unrelated class) and recompiled the project. After that I got the correct behavior above. Maybe it has to do with some miscommunication between the compiler and the engine. If something like that happens to anyone, make changes in the code, recompile and restart the engine.