Where does the illustration come from?
This depends upon what software program made the graphic, the file format it was saved as before it was placed in InDesign, and how was the graphic was constructed in the original graphic software.
"Thousands of graphic elements" suggests that the graphic wasn't made well from the start.
Open the graphic in Adobe Illustrator.
Flatten the graphic in Illustrator to reduce the number of layers and elements.
Then use Save As to save and compress the new version of the graphic as an .AI Adobe Illustrator file.
Then Save As the graphic in the following file formats and see which one ends up best in your final PDF:
As a last resort, File / Export / for Screens as a .PNG file, but be sure to control the export settings to give you 600 dpi/ppi in the final file. This is a bitmap file format so you want a lot of pixels (high resolution) in it to make it appear crisp and clear in the final PDF.
See which method works best in the final, tagged PDF.
Thanks for your suggestions, but I found the culprit.
The placed PDF goes over a double page because of the size. I have therefore placed the PDF twice - the left half for the left side and the right half for the right side. So that means that parts of the PDF on the left side go over the right side, even though I have masked it. This then creates the error.
I was wrong! The real culprit is that the selection of the placed PDFs should not touch the edge of the page. I have now moved the selection one pixel inwards and the error no longer occurs.
So that is another bug in InDesign in my oppinion
Yes! That will cause problems. Didn't know from your description that you were placing a 2 -page PDF.
And yes, the solution is to nudge the PDF halves 1 pixel inward or away from each other.
It deserves to be marked as a correct answer.