The issue with Victoria succeeding a hypothetical posthumous child however is the wording of the act:
Sections 3, 4 and 5 were to apply if, after King William's death and Victoria's accession, Queen Adelaide gave birth to his posthumous child. In that event the child would become monarch, Queen Adelaide was to become regent, the Privy Council was to proclaim the accession of the new sovereign "without delay", both Houses of Parliament were to assemble, and the laws concerning the demise of the Crown were to apply as though Queen Victoria had died and the new monarch was her heir.
This wording would mean that somehow they would have to bring Victoria 'back to life'. Now the issue would be - if the child died suddenly with this wording Victoria was already regarded as 'dead' and so Ernest would have inherited ... with the consequent issues that would have given rise to.
Fortunately all hypothetical.