I think there's a way about going about these things that can make you hate it or enjoy it. I'll share some of my story as an example of how I compartmentalize my different activities.
I code for myself, I have been since I was a kid. Often they're little utilities that I find fun, interesting, or useful. Sometimes they're tested, if for instance it's something running part of my house. Most of the time they're not because testing is arduous at times. I feel very attached to what I create for myself; it's often creative or exploratory in nature. I enjoy this kind of code and share it freely, usually without a warranty.
I code for a large firm. The way I code there is entirely different. I'm very unattached to that code. It receives lots of criticism that I learn from but at the end of the day as soon as I put hands on keyboard that code is their code. I'm talented so I get to work on things I find interesting, but this job is a paycheck where I'm paid for meeting delivery deadlines at a standard of quality. As a result the code I write here is of a different nature, it's easily maintainable, testable, and quite rote. This money funds my day to day life and savings account. I enjoy my coworkers and select them carefully to the best of my ability but it's a job at the end of the day.
I also have a consulting business. I build solutions for clients or help them attain their goals. This job isn't just a paycheck because I often work with small and medium businesses who don't know what they need or how it needs to be done. I get more agency than I do at my FAANG job, but I'm still working to get paid according by meeting the clients goals. The code I write here is less rote than my enterprise code, but not as creative as my personal code. This money usually funds projects around my house or trips. I enjoy helping small businesses, but it's a job.
I also have some for-profit ventures I work on with friends. I have much more agency here, but I'm working to serve the needs of potential and current customers. My quality standard is higher but it's not enterprise code; it's not quite as rote as my enterprise code but a little more on the creative side. The goal here is to eventually replace my corporate job. I have fun doing this because it's with people I enjoy but it's a job.
Compartmentalizing my commitment and knowing my desired outcomes has greatly helped balance this whole act. Outside of those things I have other serious hobbies: biking, gardening, camping, festing, recreational hallucinogens, spending time with my dog and my partner. Many of these overlap.