Answer
Return to home depends on the aircraft's power, navigation solution, home point, obstacle clearance, configured behavior, sensor status, and the type of failure. It is a backup function, not a guarantee.
Explanation
Automation can only use the information and control authority still available. Some failures are exactly the failures that prevent an automated return from working normally.