I had an LG all in one front loader, meaning the same machine would wash and then dry clothes. Brand new, came with the condo. Same issue. Considering the 32 other tenants in the building had the same issue with a smelly machine and smelly clothes, I doubt it was a defective unit because then they would all be defective!
I tried putting bleach and nothing, it had a mildewy smell. As I would turn the washing barrel, I could hear water in there. Like i said, this was a brand new machine, only used about 3 times so again, I doubt something was broken. That plus the fact the dryer would take 3.5 hours to complete yet still leaving me with damp clothes and a huge electric bill, convinced me to get rid of it. I got a washer dryer stackable combo like the ones you'd see 5 years ago in homes and I couldn't be happier. The clothes don't smell nor does the machine and my electric bill is much lower than it ever was with that supposedly "energy efficient" front loader.
We used to have a front loader when we lived in Europe over 10 years ago and I don't remember these issues with smell. It seems that as time has passed, instead of getting better, these machines have gotten worse, judging by the online reviews as well. I will hold off on purchasing one in the future until I find someone who recommends a specific model and lets me see it in action or there are tons of positive feedback online to prove it's a worthwhile purchase.
Another thing you may want to look at is the online reviews on your machine and model. You might find other people who had the same issue
and see what they did to resolve it. This can either offer solutions or help you determine what the problem may be. They might even have a troubleshooting guide. I wish you the best of luck with this issue.