Software converting orders into cash on delivery despite having Amazon pay balance

In a clear indication of a flawed software, Amazon is converting orders into Amazon pay balance orders into COD orders automatically, even if the customer has enough money in his or her account.

In September 2018, one order in subscribe and save was converted into COD because the balance was not sufficient.
So in October 2018, the customer ensured that the Amazon pay balance was sufficient to pay for the third order also.
However in October 2018, the delivery person again started demanding money saying that it was a COD order
The parcel label also mentioned COD
So clearly there is a flaw in the software

Hence to avoid paying cash in future, the order was cancelled.