Unable to clear mission using mavlink

I am testing the codes in SITL simulator. I used this command to clear missions in ardupilot before loading new missions.


The mission types are all Mission.

After doing this a number of times. There will comes a problem where it will not be able to clear mission anymore.
It will comes with

I tried clearing
It comes with error 3 which says the command is unsupported

Anyone knows why the Mission Clear all command will generate errors after a few try

Please report a bug in github

Anyway I had a workaround solution. I will post the error in Git

All I did was just overwrite new missions into ardupilot instead of clearing old missions and writing in. It seems to do the trick.