Prepared transactions and two-phase index builds can coexist during secondary oplog application (see SERVER-43638), however single-phase index builds cannot (see SERVER-38588).
The logic to that determines whether to block checks the system's ability to support two-phase index builds. This is not completely correct, because it may be possible for index builds to operation in single-phase mode even if two-phase index builds are supported.
This will lead to potential index inconsistencies in line with SERVER-38588.