FAR 91.3 establishes in three short paragraphs that the pilot in command holds final authority over every flight - and the legal power to break the rules in a genuine emergency.
A precautionary landing is a deliberate choice to land while you still control the outcome - and it's one of the most underused safety tools in general aviation.