voltage is not a good test.it only tells you what cell has the greatest leakage to the frame, not how much the leakage is.
check ohms to frame, fix anyplace, battery included, that has less than 100k ohms between any power cables and frame.
sounds to me like you may have to get the battery fixed, a cell or 3 replaced.
code 27 says voltage to logic circuit less than 10 volts,
65 is contactor coil current of line contactor too high.
66 is field current above transistor for current limit.
one thing I know about 66 codes is that they can be generated (induced) if the control wiring runs too close physically to the motor power cables, and is made worse by a failing battery. I have also seen these codes in a truck that the wrong style of horn was installed and the horn generated all sorts of RF and voltage spike noise in the control circuits.
but the "runs fine with battery removed" is a dead [battery] give away.
This is ONLY to be used to report flooding, spam, advertising and problematic (harassing, abusive or crude) posts.