I'm an American so I don't have a total grasp of UK politics but my understanding is that when the Queen of the UK dies, the country shuts down for a few days. It's also my understanding that prior to a general election, parliament is dissolved. Now there were rumours earlier today that the Queen died (she didn't) but it made me think: what would happen to the UK if the Queen (or another monarch) died immediately prior to the election where the shutdown/mourning period overlapped with the election? Would the election happen? If so, would it have to be delayed? Would that happen automatically or would parliament need to be undissolved in order for it to happen? Do the laws surrounding the deaths of monarchs and general elections already have contingencies for this sort of thing in place? Is there a scenario where the UK is left permanently without a parliament?
Upon the Demise of the crown (which covers both the death of the current monarch or their abdication, or any other event ending the reign of the monarch), the next in succession immediately becomes the new monarch without any act of government or state required. The throne is never empty.
If this happens during the time Parliament has been dissolved for a general election, then the legislation of the Representation of the People Act 1985 comes in to play, which among other things, was enacted to
amend the law relating to the effect of the demise of the Crown on the summoning and duration of a new Parliament and to repeal section 21(3) of the Representation of the People Act 1918
The relevant passage from the act says:
(3) In relation to the current election, for the purposes of the timetable in rule 1 in Schedule 1 to the principal Act—
a. the polling day shall be—
(i) the 14th day after the day which would otherwise have been the polling day, or
(ii) if the 14th day is not a working day, the next working day after the 14th day;
b. any working day within the period of 13 days beginning with the day after the demise—
(i) shall be disregarded in computing any period of time, and
(ii) shall not be treated as a day for the purpose of any proceedings before the polling day.
So usually the election would be postponed by 14 days. In the specific case of the 2019 general election to be held on the Thursday 12th December, this would move it to the 26th, which in the UK is a bank holiday - a non-working day. So it would, per 3.a.ii move to the next working day, which is Friday 27th December
There has been an instance of restarting from no monarch, no parliament so the answer to "Is there a scenario where the UK is left permanently without a parliament?" is "No".
In 1688, James II fled England after William of Orange had turned up, by invitation of some of James' opponents, with a very effective army. James got rid of the great seal, probably by dropping it in the Thames, so it could not be used to issue orders in his name. Parliament had previously been dissolved.
The monarchy and parliament were rebooted by a convoluted process. The peers of the realm asked William, as a sort of regent, to summon the "Convention Parliament", something between a parliament and a non-parliament convention. After some discussion, the Convention Parliament decided James had effectively abdicated, and invited William and his wife, Mary, to be joint sovereigns. William and Mary took the throne. They followed normal procedures to summon a new parliament, which passed an act ratifying everything the somewhat irregular convention parliament had done.
The UK always has a monarch, because the monarchy transfers without anything needing to be done. The ceremony is simply the incumbent monarch formally accepting the role which they already have.
As a demonstration of this, when Princess Diana died, the Royal Family were widely criticised for not lowering the flag to half mast in honour of the death of a member of the family (however estranged). This demonstrated a widespread misconception though - flags on royal palaces indicate that the Queen is in residence. What people should have known (but chose to ignore) is that even when the Queen dies, flags should not be lowered - unless Prince Charles is not there, in which case they will be lowered wherever the Queen was and raised wherever he is.
Flags were eventually dipped to half mast at the time, but this was counter to protocol. The Queen being who she is, I would strongly suspect that she will have issued standing orders that flags are to be left hoisted. The monarchy never stops.