I agree, they are planeria. They usually thrive from overfeeding and deep gravel. I have had them in my Oscar tank once. My wife and I were both feeding the fish and not telling the other, and the Oscar was really messy. They are harmless and can provide food to tiny fish or fry.
I removed more than half of the substrate, it was medium aquarium gravel about 3-4 inches. I left just enough to cover the glass. I also told my wife that I will feed the fish unless I am away on business. They disappeared after that. Since then I have switched to sand or aragonite in my tanks. For me gravel was a pain, I could vaccum 2-3 times a day and never seemed to get enough out.
You can also try switching to foods that dont break apart when wet. My oscar would always chew on some pellets and spit them out. Really messy.