I may have more to say about this later. But this 2018 Washington Post article has a great discussion of how the classic move "The Caine Mutiny" (based on a great book by Herman Wouk) helped inspire the 25th Amendment.
I don't want to ruin the plot. But Captain Queeg (brilliantly played by Humphrey Bogart) is a great example of a leader who is temperamentally unfit for command, even though (most likely) he is not clinically insane, and not suffering from a physical disability.
Wouk (in the book) and the movie seem to take the position that the officers who removed Queeg weren't justified in doing so. But viewers and readers can very easily reach the opposite conclusion. Influenced in part by this example, the framers of the Amendment deliberately left some ambiguity about what it meant for the president to be "unable" to discharge his duties.