That's very concerning. Sorry to hear about your PinePhone. If you have a multimeter or voltmeter or know someone who knows how to use one, it might be worth trying to measure the voltage the keyboard battery is putting out. If it's much too high for some reason, that could explain it.
Make absolutely sure the multimeter is set to measure volts and not current or you could short the battery out!
Make absolutely sure the multimeter is set to measure volts and not current or you could short the battery out!