Your problem might be related to the updates in Google Photos API. Some scopes are removed from the Library API after March 31, 2025 which you can check in this documentation. You might also find some helpful insights in this Reddit post.