You did not buy a 999 years lease, and should not be asked to accept one.
I freely confess that I do not understand exactly what has gone wrong or where you now are, but I think you need independent advice from someone who can take a look at all the paperwork. Has not your solicitor advised you that you may take independent advice.
The solicitors will be insured, and you should be able to find a solicitor who will take this on on a no win no fee basis.
The system should work on the basis that your solicitor only allows you to exchange contracts when he is absolutely sure that you will get what you have agreed - a freehold title.
Before exchange/completion he sends you a report on title which is his warranty to you that what you describe will not happen. If he has any doubt, there is a process (requisition on title) where he puts the vendor to proof of the title before you pay up. If the vendor feels unable to offer the necessary guarantees, then the vendor has the choice of withdrawing and giving you your deposit back (this is before you complete).
If you buy from someone who does not have a right to sell, you have bought nothing ('nemo dat quod non habet').
The questions include:
what has to happen to achieve what you need
can that be done
have they agreed to do it
at whose cost
Do not underestimate the possible complexity of all this.
Why should a court grant a power of sale to someone who does not have it?