Have you tried to perform the changes on the Fortigate directly ? Is the same issue reproducible there, or it's only when you try from the Fortimanager? You mentioned in your first comment that delete via Fortimanager GUI works fine too, so as far as I understood the issue seems only when you use script . If it works in any other way and the only problem is with script, I would advise you to open a support ticket for this.
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.