Invalid sunset date when sunset is after midnight

Quite a specific situation: Reykjavik sunset on summer solstice is at about 00:04.

I am expecting that if I'm trying to calculate sunrise and sunset time for a timestamp which is day time, i'll get a _this_ day sunrise and _this_ day sunset. However the result is off by 24 hours.