The exception handling for NotMasterError errors in the createIndexes command is currently checking for two phase index build support, which may change depending on the current FCV, rather than deferring to the current index build's actual protocol.
We fixed a similar issue in the exception handler for Interruption errors in SERVER-45409.