This is (weirdly) in line with behaviour I've observed in iOS's date picker; if you set a block of dates as not available, and the selected date inside of that unavailable block, it will automatically select the first available date on open.
Why is that weird. They are both using Apple code - Swift probably has to meet Objective C dates or even uses the Objective C date functions.