How to calibrate ACS770 upon device startup
Use another channel on the ADC where you use two resistors to create 0.5*Vcc. Since this (switched capacitor) ADC always compares to an internal reference, this should provide the value you need, without calibration process.

In the software subtract the measurement of the ACS770 from this resistor reference. And correct the linearity error with the internal reference.

Obviously, you want to samples these channels in quick succession to each other.

If you are measuring AC, then you can also use a digital high pass filter to remove the offset errors.

You're using a 16 bit ADC, that looks a bit high for this sensor to me. For more precise current measurement I can recommend Sensitec CMS3000.