The fourth version of pi-hole worked great.
After upgrading to the fifth version, it stopped blocking anything at all.
The network configuration has not changed. DNS requests definitely go through pi-hole, but it can resolve domains from the blacklist as if they are not there...
In my privacy settings "No Statistics mode" was selected, I just switched to "Show everything and record everything" and the blocking started to work! I switched back to "No Statistics mode" and the blocking stopped working again.
It seems that the problem is somehow related to this.
There is another question, inspired by the care of the flash card in RaspberryPi: with this configuration, is the result of each query written immediately to the database, or is data added to the database at some interval?