Hello Nguyen:
I have downloaded your code and I was able to reproduce the error, I am still looking for a possible cause but so far at this moment I have not found something definitive. On the reference manual I found that default clock source for ADC module is the OSCERCLK but only when this is working on MHz range, could you please confirm what clock configuration are you using?.
Another thing would be the power modes, if I am right you are not changing from normal RUN mode, but please confirm if this is the case. If not (if you are entering to another power modes) please see table below.

I am still looking for more information
Have a nice day,
Perla Moncada
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------