This is one of the roles of big archival libraries such as the British Library and the Library of Congress. Some university libraries (the Bodleian at Oxford, for example) also have vast holdings in climate-conditioned warehouses for retrieval if needed.
The difficulty with being the 'library of last resort' is that you need to be careful with the stock: if you have the only remaining copy it's not obviously a great idea to lend it out! In the case of the BL, their rarer stuff can only be accessed, supervised, in their reading rooms. Even the non-unique material is often only ILLed to another library's reading room rather than for lending.