There are not alway 86400s in 1 day. Midnight is not a whole number of multiples of 86400 after Jan 1st 1970.
Isn't that an issue with the format you want to convert UNIX time to ?
I mean, UNIX time is quite clearly and unambiguously defined as the number of seconds that passed since January 1st 1970. How are UTC's leap seconds any relevant?
It's not though. Unix time is not monotonic. It goes backwards sometimes.
Another way of viewing it is that unix timestamp is seconds since 1970-01-01 minus number of leap seconds that have passed.
So certain unix timestamp can represent two different points in time, the last normal second of the day or the leap second that happened after it. This makes (certain) unix timestamps ambiguous.
Leap seconds exist in UTC, that's the entire thing.
A leap second getting inserted (which has always been the case so far, though it may eventually change) means a UTC day ends on 23:59:60, which as far as UTC is concerned is perfectly fine, nothing wrong with a minute having 61 seconds.
UNIX time though? UNIX time is (86400 * days since epoch) + seconds since midnight.
23:59:60 is 86400, so on the last second of day X you're at 86400 * X + 86400, and on the next second (the first of day X+1) you're at 86400 * (X+1) + 0.
Which is the same value. And thus one second repeats.