Reproduces on master.

```
SELECT toDateTime64('2021-03-22', 3, 'Asia/Tehran')

Query id: 26f7c373-f473-4209-8976-6ada79a8627f

┌─toDateTime64('2021-03-22', 3, 'Asia/Tehran')─┐
│                      2157-04-28 06:28:16.000 │
└──────────────────────────────────────────────┘
```
{
        YearWeek yw(0, 0);
        UInt16 offset_day = monday_first_mode ? 0U : 1U;
        const LUTIndex i = LUTIndex(v);
        
        yw.first = toYear(i + 7 - toDayOfWeek(i + offset_day));
        auto first_day = makeLUTIndex(yw.first, 1, 1);
        auto this_day = i;
        
        if (monday_first_mode)
        {
            
            first_day = toFirstDayNumOfWeek(first_day);
            this_day = toFirstDayNumOfWeek(i);
        }
        else
        {
            
            if (toDayOfWeek(first_day) != 7)
                first_day = ExtendedDayNum(first_day - toDayOfWeek(first_day));
            if (toDayOfWeek(i) != 7)
                this_day = ExtendedDayNum(i - toDayOfWeek(i));
        }
        yw.second = (this_day - first_day) / 7 + 1;
        return yw;
    }
    
    template <typename DateOrTime>
    inline ExtendedDayNum toFirstDayNumOfWeek(DateOrTime v, UInt8 week_mode) const