Did you thoroughly inspect both sides of the PCB for corrosion and other gunk resulting from the liquid spill? Sometimes problems don't occur right away, but later on as the liquid causes traces and solder joints to slowly corrode over time.
I wouldn't expect improperly powering off the computer would do anything to a keyboard, after all, they are meant to be hot-pluggable and most people don't have their computer powered from a UPS so it would be subjected to any sudden power outages that might occur. Unless there was a firmware update being uploaded to the keyboard at the time that the computer was suddenly powered off, if that's even a thing for this keyboard?
Anyways, I would suspect one of two things is happening:
A) Liquid-caused damage is present somewhere on the PCB and is causing the errors.
or
B) Somehow the firmware in the MCU is corrupted, and you've essentially just copied the same corrupt firmware onto the new MCU. This does not necessarily have anything to do with either the powering off or the liquid spill, I've seen a few occasions of MCU flash memory going corrupt seemingly out of the blue with no explanation.