Funds were returned without any itervention, so all is over, but I started to have a serious doubts what to do in situations like that. At the end you transfer your coins somewhere and must believe they are safe.
No need to worry and no need for
'trust' either (since you mentioned this word earlier).
Worst-case, you unilaterally close the channel. I do believe channel partners are even punished a little, for disappearing and requiring such a force close.
There can be penalties, depending on the settings you used when opening the channel. The issue can be that if you are not paying attention or if you or the other side have changed some things you may have to wait a while for the force close to happen. Not a big deal unless you need the funds now, but if you do you should probably not have them in an open channel anyway. I use LN a lot but still full understand, things can still go wonky.
That's all true, I just want to correct any worries or doubts about
'security' and
'trust'. There are lock times, which can be rather long, but those don't mean you won't get your money. There is absolutely no need to trust a channel partner in terms of them stealing your balance or permanently locking your funds by disappearing.
But it's true that it would be annoying if channel partners were to do this all the time and you'd be constantly stuck with channel closing transactions waiting to be spendable.
As an example, think of all the people in Cuba, Florida, and anyplace else that was just fucked up by Hurricane Ian. If you were running a node at home, or in your business, you stand a good chance of being offline for weeks now. If I had a channel open to someone there, and there is really no way for me to know where you actually are, I could wait a week before deciding to do a force close, and then be waiting 'x' number of blocks / time for that to actually occur. Through no fault of mine.
That's true; it's how the Lightning Network is designed. So that you're always guaranteed to get your funds back out, even though it may take a while.
The only risk in such a scenario is that if you knew for certain that the channel partner is going to be offline for a while and that they have no way of restoring a node backup on an AWS instance or don't have a watchtower set up, you could attempt cheating on them.
But for you, there is no risk (referring back to the terms 'security' and 'trust') here other than losing
'time' / opportunity cost to do something else with those funds during that time.