@giuseppe bottani Thank you for reaching out to us, from the issue description seems like there is a conditional access policy configured from defender for cloud apps - https://learn.microsoft.com/en-us/defender-cloud-apps/proxy-intro-aad based on several risk factors, one can block the access.
Would request you to start the investigation from the defender for cloud apps configuration, which would help to isolate the issue.
Let me know if you have any further questions or need any further help, we can connect offline to discuss further on the same.