Why was there always a 2-3 week delay between date of manufacture and dispatch date

I have several old Jags and on the Heritage certificates there are always this sitting around, probably outside in rain and sun, before being transported to a port somewhere.
Why this procedure…?
(BMW did exactly the same, by the way)

Probably for exactly the reason you suggested, waiting for a slot on the ship for export.

Cars seem to have been built in batches by color. Each car got two test drives, then add possible corrections, collecting an assortment of models, accessories and colors for a shipment to a certain distributor such as Henleys or Hoffman or Hornburg or Brysons.

Two interesting questions: why the time between build date and despatch? And order on the production line?
As to when they went on the production line, It doesn’t appear to be entirely on what colour was ordered
Our ‘S’-type, P1B79909DN was built June 21, 1966. Here’s a snapshot of went on around that time.
On that day eight cars were built: 1 Maroon w. Black; 2 Maroon w. Beige; 2 Carmen Red w. Black; 1 Primrose w. Black; 1 Warwick Grey w. Beige; and 1 Silver Blue w. Dark Blue.
The day before; 1 Dark Grey w, Black; 3 Dark Grey w. Tan; 1 Warwick Grey w. Red. There were more than 5 cars built June 20, but these are the ones I know about.
The day after, June 22: 2 Silver Blue w. Dark Blue; 2 Silver Grey w. Tan; 1 Silver Grey w. Black. Only 5 ‘S’-types were built that day.
And June 23: 1 Silver Grey w. Dark Blue; 1 Dark Green w. Black. And again this only some of the cars built that day.
As to despatch, data for these twenty ‘S’-types, chassis numbers 1B79901 through 1B79920 show deliveries to: Peter Lindner - All cars built in this period were dispatched June 29; Delecroix (France) 1 car dispatched June 31; Jaguar of NY - cars, built June 20 and 21 were despatched June 28, cars built June 21 despatched July 8.
The exception to those despatch dates are cars picked up a Browns Lane under some kind of Overseas Delivery Programme. One of the Peter Lindner cars was picked up June 29 by its new owner from Israel. Jaguar of New York had three cars on such a programme and the New York owner pickwd his up June 28 and the New Jersey owner July 8.
The interesting one is our ‘S’-type. We ordered it from Jaguar of New York April 6, 1966 to be picked up at Browns Lane September 1, 1966 (the first day a car could be registered in the US as a 1967). Like Rob Riley, I think the week or two was generally used for test drives, corrections, etc. Why was ours built June 21, about 9 weeks before delivery?

And their situation could have been different at different times.
Here is a shot of the assembly line c1953 and we see a batch of light colored XK120s, probably all cream.
We can be less certain about the Mark VIIs, could be several colors that look the same in B&W, but there don’t seem to be any black or cream in this lot.
Browns Lane 53
Here is a shot of the dispatch area c1952, cars waiting to be shipped out. At a rough estimate there are about 80 to 100 cars in this dispatch bay, and of many colors, and three at least with the optional white wall tires.

My XK120FHC was built in a batch of I believe about 6-7 all pastel green metallic with suede green interior; one of my seat upholstery pieces has a body number several cars after mine.
My car was built in Nov '51 but was dispatched in Feb '52 through the Coventry distributor to a French customer who may have picked it up in person at the factory, in that it had a UK registration.

Here’s an odd one: my maroon 420G was built on June 27, 1966. It has a late 4,2 Mk10 chassis number: G1D76799. The official number sequence for 420G started with 77000. The car remained with Jaguar, in Coventry for 5 months, being dispatched on Nov26, 1966. The first owner got it on Jan 20, 1967.

The G with associated minor changes could have been added during those 5 months in Coventry…?!?
A related story, but not linked to my car, reports that there were about 100 4,2 Mk10 cars stored in the port of Montreal in the autumn of 1966.

Probably waiting for the RAC or AA to help get them started!