The Battery percentage is mapped incorrectly. the battery voltage is not a straight line with the remaining capacity in the battery, for example you can see the discharging curve of a sansung 29E on this link.
https://irp-cdn.multiscreensite.com/80106371/files/uploaded/file9.pdf