I do agree that a large part of it is attributable to the K5, however my K20 today is still under warranty till next March, I believe. CRIS had to order parts for my K20 last March when it was in the shop, so I would expand your statement to include models that are under warranty, that should have parts carried in stock.
Pentax USA knows how many units and of what model are sold. They also know how many warranty cards are sold (they keep going out of stock at B&H, I read - and how does that happen?). In addition to the number of each model sold (body and lenses), they have MTBF (mean time between failure) statistics for each part, which are rolled up into each sub-assembly and each LRU - line replaceable unit - each replacement assembly. They have all of this information during the design, before they build any production units. Then there are additional statistics gathered on the actual failures that are compared against the expected statistics. Bottom line, they know what the repairs / failures are going to look like when they roll out a new model. Now, things happen - like the stains, front focusing with the tungsten light, etc., that can be factored in - in real time. Add to that the shipping times (in transit) for the parts, and you have a supply chain model, that Pentax Japan already has in place and watch on a daily (or at least a weekly basis). This supply chain model feeds both production and repair requirements. Based on sales in various regions, the spare depot level (CRIS) needs can be projected pretty accurately. What it comes down to is on their production line, where are they going to allocate the units to - new sales or repair. I do think that the stains issue threw a monkey wrench into the spares distribution early on. But, going back - they still had distribution and supply issues with the K20 (my unit - where I had to wait ~3 weeks for parts). Bottom line, Pentax USA needs to have adequate parts on hand to cover the shipping time (probably plus 1 week). So if shipping time is 3 weeks, they need 4 weeks of repair assemblies and parts on hand for all their various models (bodies and lenses).
Yes, I certainly understand that this parts supply represents (unused) capital on the shelf, and thus cost of money. But, in the end, this cost is managed against customer satisfaction, and it appears that customer satisfaction looses at least most of the time. It appears that there are two decisions areas - Pentax Japan and Pentax USA - 2 different profit centers. Pentax Japan allocating production across new product and repair/spares, and Pentax USA trying to effectively manage the amount of unused capital sitting on the shelf. The other aspect is the transit time cost - what is the cost of the 3 weeks on the slow boat from where ever vs. a box of 100 K5 guts / sensors on a JAL 747 with next day delivery (with customs management thrown in).
In talking with a in town (Phoenix) camera repair center (not CRIS) - I am told that Pentax subs its sub-assembly manufacturing to Samsung and Manshuita. Neither of which are small. The manufacturing capacity is certainly there - even considering the earthquake. The K5 has spotlight this problem, however - I believe that its been a problem on the ragged edge, and tipped by the K5 problems that have essentially pushed the repair and warranty work system off its balancing point. The after market support and logistics (sparing) system needs some attention.