Honestly, to me, it sounds like even if you were able to find an entry level job that provides training and would take you on, it would still not necessarily be suitable for you. You have no guarantees of what expectations would be placed upon you as a junior hire for a company that doesn’t care if its programmers have any experience or knowledge of programming - it sounds like a recipe for a black company nightmare, and not something that will be any less stressful for you.
I don’t know what it is that makes you concerned about returning home, but if it’s not egregious you should seriously consider it as a possibility. Your ability to both find the sort of help and treatment you need in order to manage your condition, as well as retraining into software engineering, is greatly increased if you do so in your home country (I feel very confident on this point if your home country is somewhere like the US, Canada, Aus, NZ, or Western Europe - less so otherwise). Even more so if you have family/friends at home to lean on.
If that’s totally not an option: you say you have 9 years of experience; have you looked into Japanese permanent residency? 10 years experience is the main hurdle to cross, and you’re almost there. If you get permanent residence, your ability to remain in Japan would no longer be tied to your job, and you’d be able to quit this job you hate without worrying about being expected to leave Japan. You’d also likely be more attractive to employers as an inexperienced new hire if they didn’t have to worry about your work visa.
You could also look for remote work at non-Japanese companies. Imagine this: you stay in Japan as an English teacher long enough to get permanent residency. You use your new longer-term re-entry permit to go home for a year or two, and get medical help and find your first job. You make sure you only look for work in companies that are cool with you working from Japan. You re-enter Japan as a permanent resident, already with a job, and your new life commences. It’s definitely not an easy path, but permanent residence gives you sooooo many more options, and it might be possible for you considering how long you’ve already been in Japan.