Adding this config line into my code after spark session fixed the issue:
spark.conf.set('spark.sql.legacy.timeParserPolicy', 'LEGACY')