I'm not sure what runtime you're on, but if you're using a runtime with spark >= 3.0 this is a datetime pattern issue. Databricks SQL uses the following for datetime patterns Datetime patterns | Databricks Documentation in the latest runtimes.

In your case I believe you'd want to change your statement to the following:
SELECT TO_DATE('20250217','yyyyMMdd');