No spark when hot 1999 Dodge

1999 Dodge with 3.3 engine, replaced with used engine per failed oil pump caused engine seize, ran great for 20 minutes, then no spark. Weirdly, several times it would start with the alternator wires disconnected, but alternator tested ok at 2 different shops. Last time ran fine several times without alternator, and then with it. After about 20 minutes no spark again. Coil pack replaced, relays ok, coil does seem hot but gauge reads normal. Any suggestions please!

I assume you have checked for any error codes in the ECU. There may be a problem with one of the sensors causing this to happen. Check for power getting to the ignition system while the trouble is occurring.