$2.40 each a few years latter than 1940. Do you really think you can make a machined steel semi-automatic pistol for the same price or cheaper than a stamped sheet metal smooth bore single shot?
The Luger was a notoriously expensive pistol to make. According to your numbers the .45 would be threes times more expensive. The true situation is that the .45 was not more expensive than the Luger and fell some were in between the Luger and P-38 in cost.
The Luger was more expensive to produce then a P-38 just as the MG-34 machinegun was more expensive to produce then a MG-42. However neither the Luger pistol nor MG-34 machinegun were expensive compared to contemporary weapons.
Not a gun expert by any means but I believe the Lugers toggle lock and cam action needed a fair bit of hand finishing to function reliably. This seems to have been a common thing on all toggle action weapons and must have raised costs.
I don't know about the hand finishing but the Luger had a detachable side plate holding part of the trigger mechanism that fit rather tightly. that was one of the complaints about the Luger. it was so tightly fitted that small amounts of dirt jammed it. The .45 rattles when you shake it but has room for dirt and sand ( at least a bit of it). The looser tolerances make for less fitting and easier machining. Some cut aways.