Hello G.,
In fact, you must declare all the constraints first, and then the task flow...
Here is a good declaration:
@startuml
title Planning des ressources
language fr
project starts 2021/10/18
printscale daily zoom 2
saturday are closed
sunday are closed
2021-11-01 are closed
2021-11-11 are closed
' Jours fériers
{Res} is off on 2021-11-01
{Res} is off on 2021-11-11
' Res est au 4/5ieme
{Res} is off on 2021-10-20
{Res} is off on 2021-10-27
{Res} is off on 2021-11-03
{Res} is off on 2021-11-10
{Res} is off on 2021-11-17
{Res} is off on 2021-11-24
' Ensuite les tâches...
[Task n°1] on {Res:100%} lasts 4 days
then [Task n°2] on {Res:100%} lasts 4 days
then [Task n°3] on {Res:100%} lasts 4 days
then [Task n°4] on {Res:50%} lasts 4 days
then [Task n°5] on {Res:25%} lasts 2 days
@enduml
Then, we observe the expected result:
See also doc. on PlantUML Gantt help page.
If that can help,
Regards,
Th.