After seeing your advice, I tried to upgrade the related packages but the example code did not work. I was using Julia 1.6.3. Then I installed Julia 1.7.1, then the feedback was “Wrong number of colors. Must be 5 or double. …” I could only make a square pyramid with 5 colors. Later I upgraded GLMakie under Julia 1.7.1, and now I get the nice cone!
So this is simply a problem of versioning of packages and software.