I'd give up on rewashing and try hanging everything out to dry outside as fresh air and sunshine
is a great bacteria killer and will also freshen the wash. Do an empty wash on 60 with detergent and leave the door open afterwards. If the clothes still smell when they are dry, sort them by fabric synthetic/natural as well as colour and rewash in small loads.
I used to get the same problem. Tried everything I could think of.
My machine drains into the sink waste and there is a bit of a backflow issue leading to the potential build-up of stagnant water. When I was doing 10 wash loads a week, it wasn't ever a problem, but now that I am down to 3 washes a week I have started to be a bit more diligent about bleaching the sink with the shared waste.
I couldn't understand why I'd have a problem with a dark wash and not an everything wash problem.
Then I noticed that if the dark wash had been accumulating in the washing bin for a while it was really stinky after washing even if it hadn't smelt before. Something was happening inside the machine! I weighed the amount of powder that I was using - which was enough to get everything looking clean and I discovered that I was using a lot less than the recommended amount. My theory is that washing everything gently in lightly soapy water at 40 provides the perfect conditions for bacteria to grow, even as the dirt is being removed.
But why would this be a problem on dark stuff and not light? I realised that my dark wash is usually dirtier than the light wash. So if there was bacteria in the washload before you start, it will multiply dramatically during the wash. My dark load includes clothes that had been waiting to be washed for a few days; synthetic fibres which hold bacteria more than natural fibres and clothes that had more bacteria before washing in in the first place: sports stuff, socks, dirty jeans, etc, whereas the light colours tended to be recently lightly soiled stuff and natural fibres
I tried making sure that nothing waited too long for a wash - which in my house often meant washing a half load of darks and that helped.
and I made sure that I weighed the powder and used the recommended amount. The problem has now gone away and hasn't reoccurred.