TSubclassOf get pointer to object of type 'class'

The objects in your “myobjects” are of type TSubclassOf, whereas you’re trying to return a pointer to an instance of UMyClass. If you’re looking to just access the items in myobject, you will have to change the return type of the function to TSubclassOf. If you are looking for a pointer to an instance of UMyClass, you will need to create one first and then return that.