I don't know from where you took the example code you posted above. But, when I see something like this, my first thought is: the problem is a "POOR DESIGN".
It seems you misunderstood something here. The code is exactly what you called it "example code".
It is not meant to be used like this, it simply demonstrates a specific point, without paying any attention to the quality of that code. The quality of the code does not matter since it is not meant to be used. After all, it has a bug deliberately placed in it.
I am not going to play a symphony, if I want to demonstrate that a musical instrument is out of tune.
Sorry, my english is getting worst year after year

I understood what you said from the start, but ...
Once upon a time (few year ago when starting with Lazarus) I had a problem with the use of const parameters. My silly first thought was "FPC" has a bug. Never the less I needed to solve it some how and go ahead.
After many unsucceful tries, I stepped back to have a wider look and see the objective vs. what I was doing.
Then I saw it: I MADE A POOR DESIGN.
I was ashamed because I wrote a method with a const param, which used another method to modify a variable. In some cases the variable to modify and the one used as const parameter WERE THE SAME!!!
For god sakes!!! What the hell I was thinking?! I was thinking? Really?
If compiler would allowed me to do that, the things would have worked from the start (really?).
But I had to rethink the whole process and I came with a better solution:
o- More reusable.
o- Easier to understand.
o- Easier to maintain.
I want to remark something you said:
Btw: The compiler behaves exactly as it is documented.