I wrote:
> (I've not figured out yet why the "cluster" step is required to
> make this repro work.)
Oh, of course: the failure only occurs if we think the index is clustered
or a replica-identity index; else we don't store a request to rebuild it.
The attached seems to do the trick.
regards, tom lane