After a failed index rebuild, duplicate rows can exist in sys.partitions as a result of a user process holding an exclusive table lock. The exclusive lock can block the OnlineIndexBuildRollupCleanupTask task from executing, which can cause duplicate rows to appear in sys.partitions.
Often users rely on something like SELECT COUNT(*) FROM sys.partitions WHERE object_id = 1234 AND index_id < 2 to quickly see if the table is partitioned or not.
Because OnlineIndexBuildRollupCleanupTask is a background task, the traditional methods for detecting blocking do not work. Instead you have to turn to something like Profiler to filter on OnlineIndexBuildRollupCleanupTask to see that it is timing out its lock acquisition. This is not ideal. It would be great if there were better monitoring in place (XEvents?) to help identify when system background tasks are being blocked by user processes.