Invalid syntax near RECURSIVE when creating a routine
It helps to pay attention to what error messages say (emphasis mine):

check the manual that corresponds to your MariaDB server version for the right syntax to use near 'RECURSIVE&quot;

meaning this particular version of the server has trouble understanding what &quot;RECURSIVE&quot; means. When we do check what the manual says about &quot;recursive&quot;, we indeed find that

Recursive Common Table Expressions have been supported since MariaDB 10.2.2.

Generally it's a bad idea to use different DBMS versions for development and production. As mentioned in the comments, &quot;grade your desktop up&quot;.