valueAsDate: ”The date returned should always be interpreted as a UTC time”
The setHours trick will probably not work as expected if the user is on a timezone with a positive UTC offset.
They select a date in their local time, but in UTC, the date is still the previous day’s date!
So when user selects 2025-07-30 in +09:00, the UTC datetime will be set to 2025-07-29T15:00:00Z. setHours will then make it 2025-07-29T00:00:00Z, the date part of which would be rendered in local time as 2025-07-29, a full day off from what the user intended.