Never loan money to friends is like “having money 101.” You can gift it or you can invest it with appropriate caveats given to any external investor, but never lend it.
This is common advice because it turns good relationships bad, that manifests as viewing former friends as shysters
I think the main issue, is that most people are reluctant to ask a friend for a loan because its considered in poor taste. If they are asking they either have no qalms about asking which is a red flag, or they are super desperate which probably means its unlikely they would have the ability to pay back.
Of course not everyone is like that. The issue is you don’t know who is ex ante, and often people aren’t that way ex ante, but one thing leads to another to a total breakdown in trust and respect.
Even in the case you describe, it’s much better to gift it: “if you want or are able to pay me back some day, go for it, but I don’t expect or need it.”
This is common advice because it turns good relationships bad, that manifests as viewing former friends as shysters