Have you tried a complete memory test? Boot Amiga Test Kit from a floppy disk and run 'test all memory' for a few hours.
https://github.com/keirf/Amiga-Stuff/releasesIt would be worth exchanging the two QuikPak CPU boards between the two A4000T, which would narrow down if the problem follows the CPU board or not. That would tell you where to look next.
Not directly relevant, though known compatibility issues with the QuikPak boards:
https://bboah.com/index.php?action=artikel&cat=45&id=2093&artlang=enLastly, check the two AT power connectors at the main board. I've worked on several A4000T which had random instability/freezing that was caused by power connector problems. If there's poor contact in the connector, this can cause excessive heat dissipation, discolouring the white plastic of the connector, and results in an unreliable +5V supply at the main board, which is critical.