This was pretty interesting to check into. I found some pretty clear answers in these two papers:
A study of impurities in intermediates and 3,4-methylenedioxymethamphetamine (MDMA) samples produced via reductive amination routes and
Basic and neutral route specific impurities in MDMA prepared by different synthesis methods: Comparison of impurity profiles. I think Google Scholar will only let you see the abstracts, unfortunately, and the info with the answers about the PMMA is in the body.
The first paper identified all of the impurities at every step of the process along multiple synthesis routes, and they identified a compound called
estragole in commercially/industrially purchased safrole. If you take a look at the structure of estragole in that link, you can see that it is an analog of safrole, and if that compound is put through all of the same processes as one of the common safrole routes to MDMA, it becomes PMMA. Futura quoted a bit above that mentioned anethole. Anethole is what estragole becomes after the first step of the synth route I referred to before.
The paper didn't list the relative amounts and I'm assuming the estragole impurity is only present in very small or trace amounts most of the time, but if a chemist got a batch of safrole that was particularly badly contaminated with estragole, the resulting MDMA could have a serious PMMA contamination.
The second paper did analysis on some MDMA samples produced by a different safrole route and also found traces of PMMA, but there wasn't any elaboration on HOW it got there and it isn't a route I am very familiar with so I don't really have much to add there. Since it starts with safrole and ends up at MDMA, and the ends of estragole and safrole actually participating in the chemistry are identical, this PMMA got here the same was as the PMMA from the other route.
Short answer: safrole conatiminated with estragole can be responsible for accidental PMMA in amounts that may vary significantly from batch to batch.