Thanks for the details.
Your descriptions add a myriad of potential possibilities, but a much more defined direction than previously stated.
The first thing that stands out is that an intermittent starting problem appears to have begun in the summer of 2024.
With the age of the truck, faulty grounds, chaffed wiring and corroded connectors should be considered, especially after an engine replacement.
Add to that, displaced connector pins during reassembly.
I'm trusting that before the summer of 2024, there was no starting issue, and therefore, this may have been the beginning of the same problem that you're now experiencing.
Just a possibility, because intermittent faults can be very confusing and difficult to isolate.
As Burla suggested, the WIN module could potentially cause these problems, and it is worth the time to verify proper functionality. WIN faults are notorious for creating intermittent grief.
You will find many threads discussing troubleshooting WIN module faults.
Also, search YouTube for troubleshooting, repair, and replacement of WIN modules.
From the information above, I would start my search here. Review anything and everything within reach of this work area, and any other activities performed during this rework session.
It sounds like something changed from the start to the finish of this rework.
Also, were all the common grounds completely refurbished and cleaned to bare metal during the engine replacement activity?
Our rolling microcomputers are extremely sensitive to anything but near-perfect B+ and ground connections.
.