As well, with a visa you won't have to worry about the mess you'll be in if your arriving flight is so late that your flight to HK has already departed, and you no longer hold a valid confirmed booking on an onward flight. Solvable, I suppose, but with so much less hassle if you can just head out with your visa, particularly at that hour when airline staff to help sort out the problem may be scarce.
That you've a child with you also suggests a conservative approach might be best.
EDIT:
Look at the recent ontime performance. Unless the situation changes, you're going to be out of luck. That flight's arrived Beijing after 3:30am on every one of the last five flights currently shown, 29 April to 3 May:
https://www.flightradar24.com/data/flights/ps287
And when you check in at Kiev, perhaps the staff will know the flight will in fact be arriving after your onward flight and deny you boarding. One thing to be stuck in Beijing. Quite another Kiev.