I suspect that you have few "Rec Read" message in memory. Delete them all and than send a new one and try again your code.

Since you don't know how many sms are stored them loop several time with the "AT+CMGD=1",13 , wait for the "OK", leave a pause 5000 and repeat.

Al.