L1234-5 (which is a very nice number) merely says that you have to pay the employee a compensation if the préavis is not respected, equal to the amount of days the employee would have worked, in addition to everything else (severance package, etc). It gets more complicated in the case of massive layoffs, because the CSE/lawyers get involved, and for a 50+ employee company firing over 10 employees, a plan de sauvegarde de l'emploi is put into place, which lasts multiple months.
On leave, you are trusted as an employee to not do any work. Anything you do will be your own responsibility, or eventually the employer's responsibility to refuse any work you hand over. You are also not covered by the company's insurance on your leave. Your company cutting off access is a clear breach of contract.
This does sound non-sensical to me. If someone is not working, there should not be any entitlement to access.
To give you an example: let’s say a factory is temporarily closed due to lack of supply materials or modernization and workers are put on paid leave. Are those workers allowed to visit their workplace to access their tools? If not, why digital workers should have this privilege when they are on paid leave?
Article L1234-5 [1] of French Labor Code looks like it is possible.
* [1] https://www.legifrance.gouv.fr/codes/id/LEGISCTA000006195622...