Electrical mystery on my 1999 tacoma pre runner

I installed a new engine in my pre runner. upon completion and a thorough check of fluids connections and such we lite it off ran beautiful and everything seemed to function.
Put the hood back on and installed the skid plates and got ready to pull it out of the garage that’s when things went pear shaped!!!
My son fired it up it ran for a few seconds then shut its self off. the idiot lights would stay on even after you turn off the key and remove it. put the key back in turn it to run but not to start position and that will reset everything. the only thing un effected is the door lights. if the key is in it you can step on the brake and the ac clutch comes in and everything goes goofy. turn the key off then back on and try any function be it headlights ac brakes pedal or attempting to start and it goes all goofy.
Any ideas where to start looking. ran great for an hour before all of this started.
cheers

Go back and look at the grounds that were effected during the engine swap.

One bad ground can have all sorts effects on the electrical system.

Tester