Even if TF2 comp is dying, who gives a shit? Look at how much people have achieved with this game based off just the communities efforts to make it happen!
Anyway, for me the game is suffering from a few things:
1. No matchmaking, this may be a small thing for some but for me it's a big deal. There's a massive change in player habits in terms of games over the last 10 years, it used to all be about joining your favourite server and meeting the same group of people etc. Now it's based mainly on matchmaking and playing a competitive format, community aspects of games are somewhat slipping away and no longer being a focus (CSGO, Dota2, LoL, COD). This means that people are used to hitting play and actually playing the god damn game straight away in a competitive environment.
This creates a feel that TF2 is more casual as there isn't really a progress report unlike the other games out there.
2. Unlocks ARE shitty, people you can argue all you want about how us not using them is hurting the popularity but we literally have no choice. No other FPS title has such a diverse set of weapons and classes, balance is an integral part of FPS games, OP guns get used and toned down, underused weapons will at most part be left underused. In TF2 it's not like this so much, OP weapons are INCREDIBLY OP and will get used but not nerfed. Valve can't expect 6v6 players to start using wrangler mini sentries on badlands spire in the hopes they will see how OP it is and nerf it, we already know it's a fucking joke but they just leave it.
3. Competitive resources are also a big thing for me, before TF2 was F2P we used to have MGE which was a great source of pro player guides etc. Now with TF2 F2P we don't have anything like that to help people come in to the game, yeah we have streams, but MGE was actually pretty decent as the content was pretty good quality.
4. Hype, I can't really comment on the NA scene that much but for the EU scene there is a large lack of hype these days, the grand finals for S19 happened and there wasn't really much hype being built around it, it might be because of the shit teams but who knows.
Regardless of what happens to TF2 you can still be fucking proud of what we've done, look at logs.tf , spectator plugins, NodeCG, i52, i49, i46 and many more, this was all done with the communities efforts who love the game and nothing else.