"What did I do wrong?"
The documentation you referenced clearly states it's behavior with two input arguments: "REDWHITEBLUE(VMIN,VMAX), by itself, is the same length as the current figure's colormap. If no figure exists, MATLAB creates one."
If you are using a UIFIGURE (with it's default hidden handle) OR there is no figure open then I would expect a new figure to open, just as it's documentation explains.
we can also see in the code that with two arguments GCF is called: what do you expect to happen when GCF is called?