One idea, may not be your cup of tea though... I don't know your situation as far as family.
Have you considered joining the military? It provides structure, a million different career paths, travel, comradery and physical fitness. Plus a pension if you stay in for 20 years. On top of that there are multiple branches to choose from depending on your wants.
If I had reached burn out in my twenties, I would have joined the military.
I'm like you: I have very hard time working on something someone tell me to do, yet I can spend hours working on my own projects without any issue. Of course this led to pretty big issues like failing my PhD and having to go back in my country. Then I quitted my first real job after 4 months because I was feeling I wasn't pay enough and the conditions weren't to my liking, and finally found a full remote one which pays quite a bit more.
My advice would be to either find a job in which the conditions aren't too bad (4 days weeks, full remote, etc.), or a government worker like position where you can be paid doing jack shit.
That seems to be the main issue. I tried sysadmin for a while, it was more varied than a swe role and I enjoyed it more, but after a while it still became "boring" and mentally unbearable. I like writing software for myself however.
I've had this issue since school. And as soon as a subject is done with, and the pressure of "have to" is relieved, I actually start to give a shit about it. By then however, I had already gotten a bad grade on the exam.
I'm probably some kind of neurodivergent. Not sure what exactly is "wrong" with me, although I've had plenty of "professional" help.