This happens to me sometimes.
At other times, former employers come looking to hire me again.
The social security office have rated me in the worst category for unable to keep a job.
For about 25 years, I have been working on computer contracts in a specialist area.
Most co-workers are nerds and geeks who focus on the technical task and not the office politics.
Many co-workers work non-standard hours, so me arriving late or working back late is their idea of normal.
Other work that has suited me includes something where I face customers, where the interaction is only a few minutes long.
Or as a trainer, where I shift into extrovert personality and we all have fun.
Maybe a change of job could help.