Or, for a rarer subcase where the person genuinely has no name at all - consider "feral children": https://en.wikipedia.org/wiki/Feral_child
This works great until property Y is violated... or until you run into one without "an X". Most times you are better off to just start with unique identifiers and avoid breaking logic.
Also of course if you give your child a name that is not recognized as a name by the name register there is a process for okaying that name, so in that case your child can have a name in the family but not an official governmental name yet.
Our daughter was "Baby Girl <Mother's Last Name>" in the EMR system for a few days even though no part of that was her name and that isn't the last name she ended up with.
A bit of an orthogonal example to the thread, but I ran into an issue like that, with a solution that worked just like you described. I was using msgpack in Python 3 to send data to the browser in JSON format.
msgpack in Python 3 decodes into bytes, as (hopefully) expected by Python 3 users.
Except the data was somewhat arbitrary in terms of how it was organized or what was included (but was predictable in type), so decoding it was a bit of a pain. The problem of course was that my strings were wrapped in b'', and that was being sent to the browser, causing the JSON parsing in the browser to fail.
My first two attempts were recursive algorithms that would try and decode strings and skip everything else (we only worked with strings and numbers, or lists of strings and numbers, hence "predictable in type"). Both times it almost worked, but didn't. Even with predictable types of data, I had to try and cover a number of edge cases.
The solution that ended up working 100% of the time in my particular case was just using regex to remove the occurrences of b'' from a string version the object, then send that as JSON. Looked like an ugly hack, and probably was, but it damn sure worked like a charm. It was much easier to just ensure I built a valid dictionary before encoding it with msgpack rather than try and "properly" decode all the strings after decoding it with msgpack.
If parents get offended by this straightforward default-naming algorithm, the recommended workaround is to name the baby.
(I have seen a different protocol: state ID number is assigned after birth, parents choose name independently of the process, the two are only linked ex post)