Why login sometimes work and sometimes won't work with Selenium

I don't understand whats happening, there's a website I'm trying to log in using Selenium, and sometimes it works and sometimes it won't.

When it doesn't work it puts the Email, password, and press Login button and it just won't log in, it refreshes the page, and that's it. even when i try manually it won't log in using the chromedriver thread but if i switch to normal Chrome i can log in without any problems.

   def __init__(self):
        options = webdriver.ChromeOptions()
        # options.add_argument('--headless')
        options.add_argument('--no-sandbox')
        options.add_argument('--disable-dev-shm-usage')
        options.add_argument("window-size=1280,800")
        options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36")
        options.add_argument('--disable-blink-features=AutomationControlled')

        # Captcha options
        options.add_argument('--disable-notifications')
        options.add_argument("--mute-audio")

        self.driver = webdriver.Chrome(options=options)
        self.driver.delete_all_cookies()
        self.session = requests.Session()        
        

    def check_if_login(self):
        self.driver.get(f'{URI}/groups/26241565')

        if self.driver.current_url == f'{URI}/users/sign_in':
            return False
        else:
            return True
        

    def successfull_login(self):
        if self.driver.current_url != f'{URI}/groups/26241565':
            raise Exception('Login has not been successfull')


    def login(self, username, password):

        self.driver.get(f'{URI}/users/sign_in')
        sleep(2)        
        
        # Add username
        user_field = self.driver.find_element_by_id('user_email')
        user_field.send_keys(username)
        sleep(3)

        # Add password
        password_field = self.driver.find_element_by_id("user_password")
        password_field.send_keys(password)
        sleep(3)
        # Select read policies
        self.driver.find_element_by_id("policy_confirmed").find_element_by_xpath("..").click()
        sleep(3)
        # Submit
        password_field.send_keys(Keys.RETURN)

        sleep(2)

        self.successfull_login()
        self.set_cookies()

it happened yesterday, so I stopped the bot, I activated it today and it logged in successfully, I restarted the bot and since then it won't log in.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum