A ground-breaking facility that helps free up beds at a Lancashire hospital and also doubles up as a care home is to close.