Hello,
yes the highlighted code (Mcu_GetResetReason function) clears the reset flags but the function will also store the reset reason into a global variable for later use. So then when the Mcu_GetResetReason() is called for a second time it will still return the correct reset reason remembered in a global variable of Mcu driver.
Best Regards,
Frantisek