You should be clicking the Button tag and not the span tag, please use the below locator:
WebElement submit = driver.findElement(By.xpath("//span[contains(text(),'Submit')]/..")
You should be clicking the Button tag and not the span tag, please use the below locator:
WebElement submit = driver.findElement(By.xpath("//span[contains(text(),'Submit')]/..")