Who will all these foreign firms sell their produce to if they choose not to sell it to the UK. If there were other viable markets, they'd have sold to them instead of the UK decades ago.
They do already sell to a number of markets - they quite literally don't put all their eggs in one basket. The UK is large and will still need food, but if it cannot get through then producers will find other markets. A market that you can't deliver to is no longer a viable market.
If there are shortages due to customs/transport issues, the UK govt has the power to deal with those issues, such as redeploy more customs staff to the ports.
There is a finite number of ports, a finite number of ships and a finite number of customs officers. One of the main criticisms of the government is that they are far from being prepared in terms of customs processes, infrastructure and trained officers.
If tariffs make the goods more expensive to import, the govt can use the tax system to temporarily reduce food prices, such as changing the VAT rates etc.
There is no VAT on food, and no customs tariffs on most of the food entering the UK (and none at all on food from Europe, much of Africa and South America). It is not tariffs that will cause price rises - it is the increased cost of transportation, fuel, the fall in the value of the pound and the market effect of a reduction in supply (food will go to the highest bidders).
There is so much within the control of the govt - if there were problems, they could be dealt with on a piecemeal basis to solve.
The government is hardly in control of anything. It does not control the markets or consumers (being Conservatives, this government actually despises any sort of controls), it does not control the value of the pound, or the actions of trucking and shipping companies, or the actions of officials in our partner countries, who they seem to be going out of their way to antagonise.