I'm going to be splitting these into three categories.
Lose an ability slot but gets it back once it evolves.
These are going to be your cocoon Pokemon.
Caterpie and Weedle both lose their HA's when evolving into Metapod and Kakuna respectively, in which they get Shed Skin. Their HA's return when they evolve into their final forms.
- Larvitar loses it's HA when it evolves into Pupitar, in which it also gets Shed Skin, but the HA returns when it evolves.
- Wurmple into Silcoon/Cascoon is also the same case, no need to explain.
Spewpa actually keeps it's HA, it just temporarily loses Compound Eyes until it evolves again.
Pokemon that just flat out lose an ability.
Pikachu into Alolan Raichu, as the Pancake Rat only has Surge Surfer.
- Literally all the eeveelutions. Eevee has 3 abilities, eeveelutions only have 2.
- Sneasel goes from 3 abilities to 2 when it evolves into Weavile.
- Trapinch, as you already mentioned.
Snorunt goes from 3 to 2 when it evolves into Froslass.
Special category.
This is mostly speculation.
Now look I know Shedinja doesn't evolve from Nincada, but you obtain it by evolving Nincada, idk. Anyways Shedinja only has Wonder Guard while Nincada has 2 abilities.
- While you don't evolve an Ursaring to obtain Bloodmoon Ursaluna, in terms of game logic, an Ursaring had to have evolved, meaning it lost 2 abilities.
- Ash-Greninja is a kinda similar case, maybe? A Frogadier had to have evolved in terms of game logic, but I don't know whether it's like Own Tempo Lycanroc where the Froakie and Frogadier had their own abilities or they had regular abilities like other Froakie and Frogadier before they evolved into Greninja. And before you say "Oh, WhAt If ThE tEdDiUrSa HaD dIfFeReNt AbIlItIeS?", no. It was a regular Ursaring that just happened to look at the moon the wrong way.
Anyways, I hoped this helps. My source is scrolling through all the pages on the DB and looking at the abilities. It was quite fast to do, since I was on a computer, but yeah. Hopefully, there aren't any missing or additional abilities that the God llama (Pokemaster) never bothered to fix, but if there are, feel free to correct me.
Ok I need sleep now bye!