While checking an anomaly with @FedericoAntoniazzi , we found out that ism-policy-cronjob correctly creates new policies but it is failing to update existing ones, throwing also an error during its execution.
This is due to the lack of two parameters (seq_no and primary_term), which are required when updating policies.
So to have a perfect idempotent job, it should probably check if a policy already exists with a GET request, which returns the aforementioned parameters, and then perform a PUT, with a correct querystring.
References
Update policy
Get policy