For you to be able to delete via API, as far as I remember, the user has to be active, so you can delete it.
So in your script you will first have to enable the user and then be able to delete it.
I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.
Please, if this post was useful, leave your kudos and mark it as solved.