More detailed explanation and what I did so far.
Project Footage: Sony A7S3, 4k 4:2:2 10bit 25 and 50fps (H.265) and Sony A1, 8k 10bit, 25fps footage (not sure which codec), duration of the project 18min.
Project: 1920x817px 25fps, no additional Plug-ins, all FCPX latest Version 10.6.4, the project is stored on an external Samsung T5 SSD
Problem: The project and the responses while editing are all fine, the footage can be viewed no lagging, no frame losses, rendering on request (I switched off rendering in the background) runs smoothly and without any problems. If I start exporting "File/export" and select one of the export types "720p, 1080p etc." the process "VTDecoderxpcService" goes memory wise through the roof, it climbs up from 2-3GB to 51GB and more, which then creates a message in Final Cut that the Sharing failed.

In the details of the error message it refers to a particular frame, but that is just the frame where it crashed, every time it is another frame and the footage itself isn't the problem. With MacOS Monterey I was able to just export 3-4min after that it crashed, I thought that the new MacOS was the problem and I downgraded to BigSur. Problem is still there, but the export goes to 16min, sometimes it runs through and is successful, but most of the time the "Sharing failed" messages appears. I wiped out my M1 Mac Mini to test whether something went wrong with the upgrade to Monterey, but the problem remained. I have a 2021 M1 Pro MacBook as well, which I regrettable upgraded to Monterey, that one I can't use at all it crashes after 45 seconds of rendering, the "VTDecoderxpcService" service simply runs much faster into 50-60 GB before it crashes - and I can't wipe out that one...
My guesses so far:
1st Guess: Monterey is the problem -> only partly true, BigSur runs better, but fails also.
2nd Guess: 8k Footage too demanding, not the problem I deleted all 8k clips from the project, same problem
3rd Guess: SSD is too slow, gets to hot or whatsoever -> copied the project files, the source files etc onto the main Mac, same problem, then I read that the SSD should be formatted in APFS, did that with another SSD - same problem
4th Guess: Final Cut not correctly installed or other interference with installed Software, I wiped out and installed from scratch directly from the app store (no installation of a backup), no other software than McOS and FinalCut installed -> same problem
5th Guess: Wrong references in clips or something wrong with the project file, I exported the XML of the project and imported it again into a complete new project -> same problem
6th Guess: Difficulties in FCP having 4k footage but only a 1080p project (too much for FCP while exporting and scaling down the video), if I export in 4k and create a new project in 4k the problem remains
Conclusion, there must be a general problem in FCP and I can't surely be the only person who has those problems with 4k+ and >20min projects and I am sure there is a workaround, but so far no one could help.
Let me know if you need further information and I really appreciate all of your ideas and help