"A user has attempted to access a login page directly" using /api/v2/tickets/password-change enpoint

Hello,
I’m experiencing a problem using this endpoint
/api/v2/tickets/password-change
I’m using a Rule (i created it years ago that’s why I didn’t use Actions) to check when is the last time the users changed their passwords and force a password change if a certain threshold is reached.
This endpoint stopped working and fires me this error:
A user has attempted to access a login page directly. This is not supported unless a “Application Login URI” is set for your application, or a “Tenant Login URI” is set for your tenant. For more information, see: Configure Default Login Routes

even if I have set the Application Login URI, I tried to set the Tenant Login URI too but it didn’t help.
How can I fix this problem?
Thank you