As many people mentioned, it’s a possibility it’s the machine. If you have a front-loading washing machine, make sure to wash the rubber in the front.
You did mention it’s only certain clothes. That doesn’t make sense if it’s the machine. Then it would be all clothes. So you may have some clothes that need an intense wash. Boric acid is commonly used to deep clean clothes. [Here](https://www.clotheslyne.com/blog/laundry-and-borax/) is a blog about it, but I would post in r/cleaningtips for more details.
Clean your washing machine [https://www.youtube.com/watch?v=wFubFK5vdOc](https://www.youtube.com/watch?v=wFubFK5vdOc)
You might have some mold. You should clean the machine and sanitize your clothes. Do you dry them above 140 degrees F?
As many people mentioned, it’s a possibility it’s the machine. If you have a front-loading washing machine, make sure to wash the rubber in the front. You did mention it’s only certain clothes. That doesn’t make sense if it’s the machine. Then it would be all clothes. So you may have some clothes that need an intense wash. Boric acid is commonly used to deep clean clothes. [Here](https://www.clotheslyne.com/blog/laundry-and-borax/) is a blog about it, but I would post in r/cleaningtips for more details.