One thing came into my mind. Is the engine block or thermostat housing painted, corroded, dirty or something? You know, ECU is grounded to thermostat housing. Two thick wires fixed with short M6 screw. It is very important to keep that connection and surfaces between the thermostat housing (cap and housing itself), and housing and block clean. I prefer to sand those surfaces (or atleast rub with wire brush) and clean with strong solvent (acetone, brake cleaner) just before assembly to remove as much oxidation as possible.
Next make sure your engine is grounded well too. Transmission, head, valve cover atleast. Also the block-tranny surfaces should be clean, because engine block is grounded to battery from tranny case as stock.
Bad groundings can and will cause vicious electrical issues that can be beyond human imagination.