You need to look at the background reasons for why the 37s and 40s were built.
The 40s were an insurance policy using known safe technology in case the untried and unproven Peak design failed.
The 40s were the Bullied SR design with an understressed off-the-shelf engine and off-the-shelf EE parts-bin cab added. Nothing to go wrong except a lack of performance.
The Peaks were a new design, built on a new production line by a team with no previous diesel experience, using a licenced engine also built on a new production line. Many things to go wrong - and they did. The engines suffered serious crankshaft and crankcase failures. Crompton-Parkinson couldn't deliver the electrics quickly enough. And even with a second production line set up, the BR workshops couldn't hit delivery targets, running at least a year behind schedule.
BR had no choice but to order more batches of class 40 even though they were inferior on paper - but at least could be delivered on schedule and worked. EE even offered to fit the later builds with uprated engines - an offer BR declined on grounds of risk reduction.
However when someone finally came up with the definitive type 4 design - the 47 - production of both designs closed, with EE losing work while the BR workshops got a large part of the 47 order.
When the 37s were ordered, things had moved on, the BR workshops were full building classes 24/25 and later 47, so the job was inevitably going to go to an outside contractor. There weren't many bidders as by then the building of diesels was proving to be a financial black hole. EE offered a cut-price design based on bits from their parts bin and got the offer - which filled the hole left by then impending closure of the class 40 line. The request was for a type 3, EE actually offered an engine which had been running at 2000hp in hot-high conditions in East Africa, but BR insisted it be derated. Whether this was for reliability, or whether the government authority was for a type 3 and nothing else is debatable. Whatever the truth, the 37s could have been built as type 4 machines but weren't.
The key thing is that this time the EE design became the standard production design for type 3, hence the numbers.
In essence, the difference is the 40s were an unwanted, but needed, insurance backstop, while the 37s were a successful main production run