Attach a file so we can see. Please state what version of FCPX and MacOS and what hardware. Also state what output codec.
If you see transient glitches in “the final output”, IOW the exported disk file, are you playing that with Quicktime Player? In that case FCPX may not even be involved.
In some rare cases, transient, intermittent brightness or color fluctuations have been reported within FCPX due to mis-identification of color space. If encoded to an output file these then become permanent in the file. However this is not pixelation. In this case the solution is select all clips, then in the Inspector under “Settings”, re-flag them Rec709.
There was an issue in Catalina if the Reduce Transparency accessibility preference turned on. That was fixed in FCPX 10.4.8.
If the output file shows random pixelation when played with Quicktime Player, try playing it with the latest version of VLC, which has its own built-in codecs.
If it only happens within FCPX, duplicate the timeline via a snapshot, then select all clips and remove all effects via Edit>Remove Effects. Then see if it happens in that timeline with no effects applied. That can help narrow it down to a plugin or effect. If it goes away, duplicate the timeline again but remove the effects from 1/2 of the timeline at a time, then 1/4, then 1/8, etc to narrow down where it’s happening.
You can also try running Apple Diagnostics on your hardware. If it finds nothing that’s not a clean bill of health because it’s a superficial check, but if it finds something it’s usually serious: https://support.apple.com/guide/mac-help/diagnose-problems-mh35727/mac
Make sure you are not running the Chrome browser which is poorly behaved and can saturate the MacOS VideoToolBox framework, causing unpredictable FCPX behavior.