I went down a YT ant rabbit hole years ago. On top of that, most garbage collection ants seem to be ants that are close to death, so that when they die, they are near the garbage/disposal area anyway, and might not even need to be carried there when they die.
I think it also helps if the dead ants are diseased / poisoned / covered in deadly fungus too. An ant near death anyway is less value to the colony, and it doesn't matter as much if it gets sick from moving the dead body
Certain bee fungi are detected by the colony's workers — a more-senior worker might then take a one-way trip out of the hive, with infected co-worker as cargo.
She doesn't come back (to not infect the hive, herself).
They also remove their dead from other places. For instance, if I squish an ant in my kitchen, somewhere between minutes and hours later it will be carried off by another ant.
Apparently if you pile up enough of them, it can reach a critical mass where the rest of the colony says "fuck this" and "nopes out". A large enough pile of dead ants near a colony entrance can cause the rest of the colony to leave their current location, pack everything up, and re-build their colony elsewhere.
My friend used this to his advantage during college to successfully evict several ant colonies from his room. YMMV.
I don’t know how successful he was if he had several ant colonies in his room. Perhaps they regrouped and returned to another spot in his room. Perhaps this particular ant colony just loved his room a lot.
Bees do the same. In fact, IIRC, honey bees do different tasks as they age, graduating from nursery duty to hive maintenance / cleaning through to actual honey collection.
We have a drawing book for little children and this is indeed clearly painted and labeled on one of anthill cut-through images, named 'landfill' for waste and cemetery.
Source: my office carpet