Code in the documentation is not working

What is your error? The code you posted works fine for me. The only error is on Line 19, but if you read the docs that error is intentionally made to make a point about ghost triangles. An MWE would be best.