If the UK crashes out of the EU with no agreement, unprepared to impose full border formalities, and shortages occur as a result, those shortages will be 100% self-inflicted because there's an easy alternative:
* On day 0 post-Brexit, inspect some small random percentage of incoming shipments from the EU, and wave the rest through. The EU's laws were good enough 'yesterday', and it's not worth crashing the UK's economy on day 0 just to make a political point.
* Over the next few months, as procedures solidify & inspection capacity increases, inspect more & more. Tweak the selection algorithm to bias it towards inspecting smaller importers over larger ones, on the rationale that smaller ones are statistically more likely to try and cheat, while large corporations tend to be more transparently compliant (if THEY try to cheat, they tend to be open about it... or at least, once they get caught, their mischief is officially documented & easy to prosecute and punish).
The point is, imports from the EU are implicitly more trustworthy on day 0 than imports from elsewhere, so there's NO NEED to go full-on-toxic-bureaucracy from the very start with them. At least, for importers willing to certify that the goods they want to bring into the UK are already IN the EU, could legally be sold in the EU, and wouldn't have been subject to any scrutiny at all the day before Brexit.
Ditto, for the border between Ireland & Northern Ireland. Just treat it like the border between California & Nevada... accept the fact that individuals will openly transport things they shouldn't across that border (including into England/Scotland/Wales via NI from RoI), and settle for knowing at least large corporations like Tesco & Asda-Walmart will officially respect the law.
Case in point: it's illegal to transport more than a gallon of alcohol or a few cartons of cigarettes from Georgia into Florida for personal use, and outright illegal to do it for commercial resale. The few who try to do it commercially end up getting caught & severely punished, and 99.9% of individuals get ignored unless they're pulled over for something & found to have a vehicle packed to the gills with alcohol and/or cigarettes.
Ditto, with California. There's absolutely NOTHING to stop a Californian from buying a non-CARB-approved lawn mower from a Home Depot in Las Vegas or Yuma & taking it home. But the law DOES effectively prevent stores like Home Depot & Walmart from selling non-CARB-approved lawnmowers in California itself... and occasionally, they go after landscaping companies that use illegally-imported equipment.
The point is, non-dysfunctional borders are ALWAYS 'leaky'. You skim off the big targets & low-hanging fruit, and ignore the small offenders who don't matter much anyway... enough to prevent organized commercial exploitation of the leaks, without turning the border into a day-long delay.