Measuring battery with low power requirement
The problem is that the ADC input works best with impedances below 10k which reads in the datasheet.
The divider has an impedance much greater than that, above 500k.
It has no chance to charge the internal ADC sampling capacitance in the given sampling time.
If you don't plan to sample very often, put something like a 100nF capacitor at the ADC input pin.
If you sample too often, the ADC sampling discharges the 100nF capacitor faster than the resistors charge it so it results into lower voltage result.