Why does uppercase Y shows the next year for the dates close to the year end when using IntlDateFormatter?

At the end of each month i want to write down the month in serbian latin alphabeth format to write down the month in letters and the full year.

Example:

Januar 2024
Februar 2024 
...
Decembar 2024
etc.

This worked fine for all months except the edge case for December where the output resulted in:

Decembar 2025

Example:

$period = new DateTimeImmutable('2024-12-31');
$format = new IntlDateFormatter('sr-Latn', IntlDateFormatter::NONE, IntlDateFormatter::NONE, NULL,  IntlDateFormatter::GREGORIAN, "MMMM Y");
$label =  datefmt_format($format, $period);

echo $label;

The output is: decembar 2025
the month is correct but the year changed

The result is the same even if the date is '2024-12-30', only when the date is lower then "2024-12-29" will the correct result show up "decembar 2024".

$period = new DateTimeImmutable('2024-12-30');
$format = new IntlDateFormatter('sr-Latn', IntlDateFormatter::NONE, IntlDateFormatter::NONE, NULL,  IntlDateFormatter::GREGORIAN, "MMMM Y");
$label =  datefmt_format($format, $period);

echo $label;

So my question is can anyone explain this weird interaction, i expected it has to do with Time zones, but that would explain why both 30 and 31st December would result the same. Also why does the year change but not he month, if it was a timezone but i would expect it to be January 2025, not December?

Tested on php7.4 and php8.2

Default timezone is: “Europe/Berlin”