Preserved steam locomotives have to have a “boiler ticket” (in effect, a permit from their insurers) to run in steam. This ticket lasts a maximum of ten years. When the ticket runs out the boiler, firebox together with all the steam passages and pipework subject to high pressure must be completely dismantled and any worn or corroded parts replaced. The owners usually take the opportunity to strip the rest of the machine at the same time. The cost of this work on a loco of the Flying Scotsman’s size usually costs a minimum of £1m and often much more. The main reason for this is that the parts are not mass produced and have to be manufactured on a bespoke basis and the skills needed are extremely scarce.
The NRM’s original estimate for the restoration (£750,000 and 12 months) was hopelessly inadequate even if all went well. However serious additional problems were found when the loco was dismantled leading to far greater work and costs than envisaged. Many heritage railways up and down the country restore large steam locos (and in fact some were involved in some aspects of the Scotsman’s overhaul). They benefit from much of the work being undertaken by unpaid volunteers. Even then the final costs can easily run to seven figures as some work can only be undertaken by certified professional craftsmen. The NRM did not benefit from much free labour and virtually all the work had to paid for.
Finally, large steam locomotives are not “simple pieces of machinery”. If you look at the bowels of one you will find it is an extremely complex beast built to very fine tolerances. British Railways used to have massive workshops undertaking heavy overhauls of locos on a production line basis. These no longer exist and keeping them running (the youngest of them 55 years old and many much older than that) takes time, hard work and lots and lots of dosh.