One difference between MySQL and MariaDB is that MySQL has a JSON column type and MariaDB doesn't.
MySQL requires that the second parameter to JSON_CONTAINS is a JSON type. MariaDB doesn't have JSON types, so it doesn't have this requirement.
We need to make sure we do the cast for MySQL, but not for MariaDB.
Depends on D4521