Ditto could still be the result of genetic engineering, some kind of genetic waste product.
That would still link to mew who was being cloned, but would also explain why they are a lot more common, and why scientists in the games use them.
Then you can still use the headcanon; genetic garbage (ditto) > sludge (grimer), etc, with no need to link to mew directly.