Short answer: Only drive home if valid cover for a full-licence driver is already in force and the vehicle can legally be driven. If that is not confirmed, another properly insured driver should take the car.
Check before test day
Find the policy wording that explains what happens at the moment of passing. Do not rely on a general marketing summary. Ask how evidence of replacement cover is supplied and when it takes effect.
Do not confuse licence and insurance
Passing normally entitles the driver to drive before the new photocard arrives, but it does not extend a learner-only policy. Licensing and insurance are separate requirements.
Make a fallback plan
Arrange an eligible person who is insured to drive the car, or another way to collect it. This avoids making a pressured insurance decision immediately after the test.