First, I would advice to stop using the love your job mental model. Instead look into the concept of "Career Capital" from So good they can't ignore you.
Second, here is another mental framework and exercise that I recommend to my mentees. Rather than thinking about job satisfaction as a line between "love" and "hate", think of it as a measure in a multidimensional space. Maybe you work with cool tech, but the commute is killing you. Maybe you have tons of fun with you colleagues, but it pays way below market.
Every day write down your mood, and what caused that mood. Maybe you are angry because of a bad interaction with your boss. Maybe you are unhappy because Tim got the new cool project again and you are stuck doing grunt work. Maybe you had fun when you went out for lunch with your team.
Once you have enough data points you can start observing patterns. I find people hardly ever completely hate every single aspect of their jobs. Most often there is a few factors driving the dissatisfaction, that paint the whole experience badly.
Then you can decide what step to take next to improve on those points. Some actions might include doing things differently in your current position, change teams or change companies (it hardly ever comes down to changing careers).
You might be thinking that this is a very long winded way of telling you to change jobs, but the self reflection step is important. I've seen people change jobs because they were unhappy, just to be unhappy in their next job. Often the reason is that they misinterpreted the reason of their unhappiness. Without that awareness they are bound to find themselves in the same situations over and over.
As a side note this isn't a replacement for help with anxiety and despair. If needed be look for professional help. Best of luck.
[1] https://www.amazon.com/Good-They-Cant-Ignore-You/dp/14555091...
IMHO no matter end at which you work, it takes time to truely master necessary skills.
Find a mentor. He/she may show you the way.
Btw, I find this book interesting: "So Good They Can't Ignore You: Why Skills Trump Passion in the Quest for Work You Love" [1]
[1] https://www.amazon.com/Good-They-Cant-Ignore-You/dp/14555091...
Meanwhile a lot of time went by, I'm almost 40, and I have worked at 8-10 companies (incl. FAANG, my own startup). His later advice, from the book "Deep Work", was not in line with my work experience [2]. The problem is, Cal doesn't have a regular 9-5 job as a tech worker, at a tech company. He's in academia (and self-employed), which is very different --- I know, I also worked in academia! And this shows.
For example, I was reading his book Deep Work while I was at Facebook, where the whole company is on Workplace/Workchat internally, with frequent notification/mention/chat interrupts, and the culture is to have quick response times. So no Deep Work, yet velocity and productivity is very high. It's not true that you need a lot of focused time to get things done, you can manage it in smaller chunks. It'd be convenient, but it's not realistic.
Reflecting on this article, in my experience, the key thing to focus on for companies is not personal productivity but team organization. The topline differentiator between high-velocity and high-productivity organizations versus the rest is that these are a collection of self-sufficient cross-functional product teams. The rest, which is most organizations, usually run "projects" instead of products, and multiple departments and teams, with different reporting lines, goals, OKRs/KPIs, etc. are exptected to work together to make it happen --- the result is the organization becomes one big waiting/blocking graph, with 80% of projects being blocked at any given time. This also makes personal productivity harder, because more "sync" and "alignment" type email threads and meetings are needed. In this model people have to work with more people they don't know/trust, so more people are communicating with each other who don't know how to communicate with each other, they may not even know the other person's exact job description or timezone location.
Having said that, I appreciate Cal's perspective, and I'm happy to support him by buying his books.
[1] https://www.amazon.com/Good-They-Cant-Ignore-You/dp/14555091...
[2] https://www.amazon.com/Deep-Work-Focused-Success-Distracted/...
[1] "So Good They Can’t Ignore You" by Cal Newport. It changed the way I look at my career and how I view my personal development.
[2] ADP 6-22 Army Leadership and the Profession by the US Army. Looking past the militaristic stuff, it made me change the way I see leader/subordinate relationships and how to start becoming a person others can depend on and look up to.
[1] https://www.amazon.com/Good-They-Cant-Ignore-You/dp/14555091...
[2] https://www.amazon.com/Army-Doctrine-Publication-Leadership-...
Until then, "play the game" and over-deliver. Your only other alternative is to return to freelancing if setting your own schedule is that vital a prerequisite.
Start trying to build your ideas with the coding skills you have. It probably won't be the thing you build, but working on a project to learn to program works better in my opinion, as you'll work to achieve something tangible instead of learning in a void.
0. Read Cal Newport's "So Good they Can't Ignore You":
Book: https://www.amazon.com/Good-They-Cant-Ignore-You/dp/14555091...
"Talks at Google": https://www.youtube.com/watch?v=qwOdU02SE0
Newport addresses career change strategies, how to build good careers, etc.
1. Read Marc Andreessen's Archive:
Link: https://pmarchive.com/ HN commented collected links: https://news.ycombinator.com/item?id=19739943
It is a collection of tweets made in a nice format, then an ebook.
Andreessen addresses a lot of topics.
2. How to Start a Startup:
Link: https://startupclass.samaltman.com/
3. Startup School (CS183F): https://www.youtube.com/watch?v=5ZXU84_sGXo&list=PLoROMvodv4...
The list is last uploaded on top position, so first video is on the bottom "How and Why to Start a Startup". Haven't watched the series except for the ones on "How to Find Product Market Fit" and "How to Build a Product II" and some of "How to Build a Product"
https://www.amazon.com/Good-They-Cant-Ignore-You/dp/14555091...
https://www.amazon.com/Good-They-Cant-Ignore-You/dp/14555091...
The short version is: Don't think of it as "get out of tech." Think, how can I move into a career that builds on what I already have in terms of skills and so forth, but has a very different day to day experience.