Create gist index on cube array with 512 dimensions
It can't find a place to store the index tuple, probably because the tuple is larger than a page and so can't fit on any page.  You could recompile with a larger blocksize, e.g. ./configure --with-blocksize=32, but then you will just run into a different limitation, probably INDEX_SIZE_MASK, which is not so easy to work around.

So, you just can't do this.  But if you could, an index into a 512 dimensional cube is not likely to be all that useful anyway.  It will probably be slower than a seq-scan would be, or at least not faster by very much.