MySQL & MariaDB error 4169 ER_CTE_EXPANSION_LIMIT_EXCEEDED
Same number, two different errors. 4169 means one thing in MySQL and another in MariaDB. Check which server you are connected to.
MySQLCommon table expression expansion exceeded an implementation limit. Simplify the query.
MariaDBAUTO_INCREMENT column … cannot be used in the UNIQUE index …