For past few times our home inverter shows an indicator informing all charge is lost though we did not use it as the power was available. I am unsure whether this happened instantly or took time. Under what conditions this can happen?
What inverter? What battery? Did recharging the battery fix the problem, and did the recharge take the time you would expect for a completely flat battery?
Batteries do self-discharge given time. How long this takes depends of the type and condition of the battery.