MariaDB and MySQL create an 'implicit index', for a foreign key whose columns are not part of an index. That implicit index is removed once the client adds an actual index on the columns involved. However, when the reverse is carried out, i.e. the client removes his actual index again, no implicit index is put back and this causes an error message: Cannot drop index: needed in a foreign key constraint. This is inconvenient for scripts that attempt to reverse actions automatically and there does not seem to be a reason that justifies the inconsistency.
Now try to reverse these actions: