What could be, but I can't say for sure from your story, is that the following is going on:
As crazy as it may sound, week 52 can also be the first week of the year. This is because in the middle of the week, for example, the transition from year 2021 to 2022 takes place. So in this case week 52 will be seen as the "first" week of 2022. Perhaps for that reason the first day of the week also falls in 2022.
Assuming it will work with a week that is far from the New Year's?
The kind of result you are getting can be because of using ‘YYYY’ in your formatDateTime, but as I see in the screenshot you are using ‘yyyy’ which is fine.
To explain more:
yyyy → gives the year for that date
YYYY → gives the year for that week
Considering that the week finishes in 2022, using YYYY will give 2022 as output.
But indeed, reading your explaination and setup this looks strange
Now i am totally confused. i have changed my microflow a little bit to check what kind of variable is creating during the microflow:
with the following setup:
Changed the following component:
What the hell? Is this a bug?