Found that the createemptyblocks option, introduced in #6082, prevents syncing a network that had some empty blocks at the beginning, that scenario could happen if a network was created without this option (or with it set to true) and then changed to false.
The validation should only apply when the node is creating a block, but not when the node is syncing/importing existing blocks.