libuv closes the underlying socket on bind error on Linux (https://github.com/libuv/libuv/blob/d898a1f6f87ba30e7803fe402121464553b2ffaf/src/unix/udp.c#L343) but not on Windows (https://github.com/libuv/libuv/blob/87df1448a48fb64c2b9ebe37e3344f7e5b81dd88/src/win/udp.c#L261). This means you get an error on Linux when closing the socket afterwards but not on Windows.