Welcome!!
FYI, Apple won't service that model any more, so taking it to them is not an option. But you sound like you know your way around the insides of yours for self-repair.
Hardware test: "4xxx" does not to fall within the typical codes that differentiate error types so must be generic for battery issues. An old Li-on battery can give up if not exercised, and yours could be 14 years old by now.
Apple Hardware test will throw either a 4MOT if the fan were jammed of dead, or a 4SNS if a temp sensor were not reporting and causing the fam to speed up to compensate. In the absence of MOT or SNS errors, an SMC reset— or two or three—sometimes helps with power issues,
As the proud owner of a still-working, upgraded 2012 13-inch (16GB RAM + SSD and the same form factor as yours), this sentence raises possible SSD issues for me:
as soon as i turn it on i start to notice that it was really slow, it would blast the fans on max RPM's and it wouldnt boot onto macos, so i try using a macos sierra bootable usb and it took 12 hours to install, and still, it wouldn't get onto macos, it would only boot with safe mode.
1) "Really slow"— when you installed the SSD, did you enable TRIMforce on it? I found that after some time, not having TRIM engages caused drastic slowdowns. Engaging TRIM and doing a series of Safe Boots usualy restores full speed.
2) Which SSD did you install? Some Crucial BX series were very troublesome in Macs; the newer MX series are rock-solid.
3) When you installed the new SSD, did you replace the hard dive cable at the same time? That is de rigueur for any drive upgrade in our A1278 Macs.
That little cable is one of the few weak spots in an otherwise bullet-proof series. The cable is actually a thin, flexible printed circuit board. Its routing puts it in contact with some rather sharp metal edges on the chassis.
Given 3-5 years of normal use and transport, the thin insulation on the cable can chafe, exposing bare copper and creating a bewildering litany of truly odd issues. Visual inspection seldom shows a bad area, making the mantra "new drive + new cable" nearly mandatory for hard drive swaps in the A1278 series of Macbook Pros.
I'll check back in later today to look for responses. I am a fan of keeping old Macs working if on a hobby or learning basis that does not break your bank. I used my A1278 until I bought an M4 Pro Macbook Pro 14" in March (it's awesome). Even so, I will keep the little 13-incher available for file conversions, and out of apprecation for 12 years of error-free service. It may qualify for frequent traveler points!