C++ TObjectPtr<> as a return type, is it good practice?

It should be fine just make sure to check if the object is Valid before accessing any of its members/functions.

You can always look at some of the built in engine functions as a reference. Returning a pointer is a common thing, what you do with it is where safety can be an issue if you don’t check for valid etc.

For TObjectPtr it’s very similar to your typical raw pointer but there are other advantages to using it. This forum post contains some good info on why you would wanna use it.