TPK is only one tool in your toolbox!
Is there a way that you could end a campaign without ruining the players experience and not just killing the party?
Sure there is! TPK is a nuclear option that can burn bridges. I am not a fan of it. Your Toolbox as a GM to fix or shift a campaign is bigger. There are many ways to bring a campaign to an end satisfactory for all sides. A TPK isn't usually satisfactory, but I learned some things from running a campaign that ran for about a year to get through the plot:
Get out the red pen!
If as a GM your campaign feels stale, you can always change it. If you don't enjoy the lengthy dungeon crawls, shorten them. If you don't enjoy the politics scenes where you talk your lips off, cut them and summarize what happens. Reallocate the experience planned in there to other obstacles they actually challenge and nobody will be the wiser.
In my case, I hate running wilderness and travel encounters, so when in my campaign they had to travel, I glossed over the whole travel. In effect, I tried to skip whatever part I didn't like. In effect, I gave them the required XP to get them to for the spot they could face the next major challenge for enduring a longer narrative, so I didn't have to face running the hated sceanage, and cut out about a dozen challenges.
Red pen is mainly a way to shorten the campaign and get to the end faster. This implies, you had a larger plan for the campaign to begin with, and now set it on fast track: cut all the not necessary stuff.
Reorient on the run!
If you feel like you can shift the campaign to a direction you like more, try rewriting the whole campaign on your notes, salvaging the background but tossing the plans and changing how the outlook of the campaign will be. It's more extreme than just using the red pen to cut content, and there's no guarantee that this is satisfactory to all. But if you start reqriting that hard early enough, you have a headstart!
I experienced adventures that started with one quest, but then it went totally sideways, and you literally could tell that the plot was re-written as it went. The players started to investigate a minor event in town, but it escalated within some sessions into a world-spanning thing... because the GM was bored and added to each and every found NPC a connection.
Reorienting is a way to fix a running campaign. You also need some ideas to do it. For those, you can at times ask the players what they want.
A system change
Your players expressed interest in social RP, for which D&D actually is the wrong game: it has little to no system for social RP. The open offer to change to a system they want to try might open the way for a gentle wrap, all parties finding a nice closure, and possibly a switch of positions for you, if you want.
A new system means everyone can try to express themselves anew and differently, new chances - and usually also new ideas.
If you just can't do it: pull the plug!
Then there's cases where people just pull the plug, because it's just no longer working. This by the way works from both sides:
When a GM tried to raise themes the group wasn't comfy with, the group I was with pulled the plug on them twice: once with a warning not to do that again, and the next time months later we pretty much fired them from their position and turned the adventure string into an IC Bad Dream the characters had been trapped in together, to keep the characters in the main campaign without need to re-calculate to before that GM's stint.
In a counterpoint, I also encountered a GM that ran a couple games in his favorite setting, but a particular player ran his ire because he happened to foster Murderhobo attitudes in the others. One day, he simply didn't put his game on the schedule anymore, and when asked why, he just pointed to the player and said "He ruined your playstyle. Maybe later, when I'm back in the mood." He stayed off that setting for some months, then started a reboot.
Pulling the plug is ending it right here and now. It's the nuclear option. It should be the last step.
Should you completely end a campaign if you aren't enjoying it but the players are?
This depends on a lot of factors. But in all cases, there's a mandatory step one:
Talk to your players. Tell them "hey, I am having trouble with this aspect. Is there anything you can think of to make it more fun for me?" or "People, please, I know you love the campaign, but topic is dragging on. Can we make this more enjoyable for me too?"
A tool that can help is Stars and Wishes, to tell the players what kind of stuff you wish for, though a house cleaning is possibly needed.
Communicating wishes for you and from your players, and being on the same page about what is fun is key to try and push the campaign. The GM doesn't have to be the driving force of the campaign, players might have plans for their characters, and knowing those offers a totally different GMming style: Catering to the player's wishes can lessen the burdons of coming up with ideas. They want to invade the clockwork museum at night to steal the golem matrix? Sure, I can work on that heist-adventure. They want to take the steamtrain to the next town over? Then you can plan for social stuff on the train, maybe turn it into a Muder on the Orient Express (though D&D isn't good at murder mysteries). In any way:
Talk to your players. ALWAYS.
Take a break!
The other GM I told you about above? he took a break from GMming that setting to get his head back into a good condition. In the longest campaign I ran kinda West-Marchy, I had taken a couple of weeks off to get back into being a player in a totally different game.
Taking a break can become softly pulling the plug too. Take a couple weeks off, let players cool down from the game. And if they found something else in the meantime, it can become a way to pull the plug softly without throwing the towel into the face of the players.