Sensor fail - revert to last value?

Is it possible to have a sensor revert to the previously recorded value if there is an issue updating the sensor?

I’ve got a few sensors that are a bit hit and miss on updating, but if it fails to update on startup it doesnt get created which is a bit of a pain