SQL Server 2016 SP2 - ONLINE REBUILD DEADLOCKed Itself - is this a bug?
Sounds like an intra-query parallelism deadlock.

They're generally considered bugs because there's not much you can do about it, other than to rerun the query or drop the maxdop of the statement down (if its happening often for the same query).

Here is some information to help troubleshoot them, hope this helps.

https://support.microsoft.com/en-us/help/4089473/better-intra-query-parallelism-deadlock-troubleshooting-in-sql-server2