I can sympathise with your situation, having found myself in a similar one a few years ago. I'll get on to what my advice would be shortly, but to give you a bit of background into why I'm advising this:
I studied Computer Science at university, so learnt quite a broad range of programming & scripting languages, along with the theory behind best practices, different methodlogies, etc. I chose to study computer science because I thought I would enjoy a career in programming- I enjoy logic & problem solving, and had always had an interest in how software worked/ curiosity regarding how you would write software.
My course involved doing an Industrial Year Placement (sandwich year), which I spent working for a large consultancy firm. During my time on placement, although my job title was Associate Software Engineer, I held a few different roles with a couple of their clients- based at the clients' sites- these roles included functional testing, and business analysis. I didn't actually get any real industrial experience of software development which is what I had been hoping for before I started, but I realised that actually, I had really enoyed the BA experience I'd had, and thought maybe I would enjoy that as a career more.
Over the first 5/6 years after graduating, I had a few jobs that were 'Software Developer' jobs (the job titles varied, but this was essentially what I was employed for). Due to the different industries that the companies I worked for were in, I ended up with a very broad range of programming/ scripting skills, including C++, Python, Angular, C#, Java. In most of these roles, I was a member of a team of developers (varying sizes, from 2/3 all the way up to 30+ spread across multiple countries). I also spent six months to a year or so working self employed, with a couple of clients- one of my clients was a company in a 'non-technical' industry, and I was writing some bespoke software for them, to assist their team with their day to day tasks. As the only 'techy' there, I ended up managing their IT as well as writing this software for them.
As time went on, I realised that I wasn't enjoying the programming side of things as much as I had thought I would before I started working in it. Sure, it was interesting, but what I enjoyed more was working with people to understand what problems they were trying to solve, i.e.e gathering & analysing requirements, and specifying solutions, rather than the actual work of building the solution.
So, I started applying for Business Analyst roles. To start with, my applications kept getting rejected, and the feedback I was getting was "You don't have the relevant experience".
So, I sought some advice from a careers service, and they helped me to re-write my CV, so that rather than being tech-heavy, it focussed on the interpersonal skills I had developed (working directly with clients/ end users to gather & analyse requirements, and drawing on my development experience to be able to articulate the requirements effectively to developers).
I started applying for BA jobs at some point while I was between other contracts, and had a few interviews. I was also still interviewing for developer jobs at this point, and found that I was still getting head-hunted for that (I had uploaded my CV to a few jobsites online). Eventually, I ended up taking a couple of developer jobs that didn't work out, and decided that enough was enough. I stopped accepting requests from recruiters to put me forward for developer roles, and decided to focus on applying for BA ones myself.
I eventually started getting interviews for BA roles, and was able to draw on the relevant 'BA experience' I'd had in my previous roles as a developer to show that I was qualified for the job. Having now been working in a BA role for about 6 months, I am really enjoying it, and think it was definitely the right move for me. I don't currently see myself ever moving back into development, and I'm looking forward to the challenges of establishing myself as a Business Analyst.
My Advice
Work out what you enjoy doing. This might take some time/ a few attempts at different things. Just because you aren't enjoying one thing, doesn't mean there isn't anything out there for you. It could be something completely different. It could be something very similar. But there will be something out there that you enjoy doing/ enjoy more than other things.
When you have worked out what you enjoy doing, figure out why you enjoy doing it. What in particular is it that gives you that enjoyment? What made you realise that this was what you want to be doing?
When you know what you enjoy doing, and why you enjoy doing it, you will know what experience you have of doing it. Try to get more experience in this field.
Draw out the strengths you have in this on your CV and when attending interviews. If you have worked with this in the past- make the most of that experience. If there is anything outside of your working life that has a positive effect on the particular thing you want to be working with- make the most of this.
It may take some time to find the right role/ company/ whatever, but don't lose heart. Look to learn from whatever your current situation is, and work out how you can use that to move you in the direction you want to be going.
One other thing to mention- you don't have to choose a speciality. There is absolutely nothing wrong with being a jack-of-all-trades. If that's what you enjoy doing, make the most of it. There are plenty of companies out there who can't afford to employ a specialist in all of the different areas/ technologies they work with, so if you can fill several gaps at once for them, by being someone who understands/ can work in all of these areas- market that.