New SMS overwrite old stored ones

Why are the received sms not showing in order? After receiving the fourth sms, instead of showing the next sms in the the fifth position it overwrites the position 0 and same with the sixth sms. The command AT+CPMS?shows only 4 sms instead of the 6 sms.
Modem is BG96.

[2025-05-27_11:16:57:770]AT+CMGL="ALL"

[2025-05-27_11:16:57:785]+CMGL: 0,"REC READ","+3463*******",,"25/05/27,11:16:50+08"
[2025-05-27_11:16:57:785]Sff

[2025-05-27_11:16:57:785]OK
[2025-05-27_11:17:14:828]AT+CMGL="ALL"

[2025-05-27_11:17:14:844]+CMGL: 0,"REC READ","+3463*******",,"25/05/27,11:16:50+08"
[2025-05-27_11:17:14:844]Sff
[2025-05-27_11:17:14:844]+CMGL: 1,"REC READ","+3463*******",,"25/05/27,11:17:11+08"
[2025-05-27_11:17:14:844]Ggg

[2025-05-27_11:17:14:844]OK
[2025-05-27_11:17:39:357]AT+CMGL="ALL"

[2025-05-27_11:17:39:467]+CMGL: 0,"REC READ","+3463*******",,"25/05/27,11:16:50+08"
[2025-05-27_11:17:39:467]Sff
[2025-05-27_11:17:39:467]+CMGL: 1,"REC READ","+3463*******",,"25/05/27,11:17:11+08"
[2025-05-27_11:17:39:467]Ggg
[2025-05-27_11:17:39:467]+CMGL: 2,"REC UNREAD","+3463*******",,"25/05/27,11:17:38+08"
[2025-05-27_11:17:39:467]Segt

[2025-05-27_11:17:39:467]OK
[2025-05-27_11:17:56:841]AT+CMGL="ALL"

[2025-05-27_11:17:56:872]+CMGL: 0,"REC READ","+3463*******",,"25/05/27,11:16:50+08"
[2025-05-27_11:17:56:872]Sff
[2025-05-27_11:17:56:872]+CMGL: 1,"REC READ","+3463*******",,"25/05/27,11:17:11+08"
[2025-05-27_11:17:56:872]Ggg
[2025-05-27_11:17:56:872]+CMGL: 2,"REC READ","+3463*******",,"25/05/27,11:17:38+08"
[2025-05-27_11:17:56:872]Segt

[2025-05-27_11:17:56:872]OK
[2025-05-27_11:18:01:080]AT+CMGL="ALL"

[2025-05-27_11:18:01:125]+CMGL: 0,"REC READ","+3463*******",,"25/05/27,11:16:50+08"
[2025-05-27_11:18:01:125]Sff
[2025-05-27_11:18:01:125]+CMGL: 1,"REC READ","+3463*******",,"25/05/27,11:17:11+08"
[2025-05-27_11:18:01:125]Ggg
[2025-05-27_11:18:01:125]+CMGL: 2,"REC READ","+3463*******",,"25/05/27,11:17:38+08"
[2025-05-27_11:18:01:125]Segt
[2025-05-27_11:18:01:125]+CMGL: 3,"REC READ","+3463*******",,"25/05/27,11:17:56+08"
[2025-05-27_11:18:01:142]Aqq2

[2025-05-27_11:18:01:142]OK
[2025-05-27_11:18:12:625]AT+CMGL="ALL"

[2025-05-27_11:18:12:656]+CMGL: 1,"REC READ","+3463*******",,"25/05/27,11:17:11+08"
[2025-05-27_11:18:12:656]Ggg
[2025-05-27_11:18:12:656]+CMGL: 2,"REC READ","+3463*******",,"25/05/27,11:17:38+08"
[2025-05-27_11:18:12:656]Segt
[2025-05-27_11:18:12:656]+CMGL: 3,"REC READ","+3463*******",,"25/05/27,11:17:56+08"
[2025-05-27_11:18:12:656]Aqq2
[2025-05-27_11:18:12:656]+CMGL: 4,"REC READ","+3463*******",,"25/05/27,11:18:10+08"
[2025-05-27_11:18:12:672]Fert

[2025-05-27_11:18:12:672]OK
[2025-05-27_11:21:07:834]AT+CMGL="ALL"

[2025-05-27_11:21:07:876]+CMGL: 1,"REC READ","+3463*******",,"25/05/27,11:17:11+08"
[2025-05-27_11:21:07:876]Ggg
[2025-05-27_11:21:07:876]+CMGL: 2,"REC READ","+3463*******",,"25/05/27,11:17:38+08"
[2025-05-27_11:21:07:876]Segt
[2025-05-27_11:21:07:876]+CMGL: 3,"REC READ","+3463*******",,"25/05/27,11:17:56+08"
[2025-05-27_11:21:07:876]Aqq2
[2025-05-27_11:21:07:876]+CMGL: 4,"REC READ","+3463*******",,"25/05/27,11:18:10+08"
[2025-05-27_11:21:07:896]Fert

[2025-05-27_11:21:07:896]OK
[2025-05-27_11:21:11:634]AT+CMGL="ALL"

[2025-05-27_11:21:11:667]+CMGL: 0,"REC READ","+3463*******",,"25/05/27,11:21:06+08"
[2025-05-27_11:21:11:667]Grrt
[2025-05-27_11:21:11:667]+CMGL: 2,"REC READ","+3463*******",,"25/05/27,11:17:38+08"
[2025-05-27_11:21:11:667]Segt
[2025-05-27_11:21:11:667]+CMGL: 3,"REC READ","+3463*******",,"25/05/27,11:17:56+08"
[2025-05-27_11:21:11:667]Aqq2
[2025-05-27_11:21:11:667]+CMGL: 4,"REC READ","+3463*******",,"25/05/27,11:18:10+08"
[2025-05-27_11:21:11:681]Fert

[2025-05-27_11:21:11:681]OK
[2025-05-27_11:21:52:169]AT+CMGL="ALL"

[2025-05-27_11:21:52:196]+CMGL: 0,"REC READ","+3463*******",,"25/05/27,11:21:06+08"
[2025-05-27_11:21:52:196]Grrt
[2025-05-27_11:21:52:196]+CMGL: 2,"REC READ","+3463*******",,"25/05/27,11:17:38+08"
[2025-05-27_11:21:52:196]Segt
[2025-05-27_11:21:52:196]+CMGL: 3,"REC READ","+3463*******",,"25/05/27,11:17:56+08"
[2025-05-27_11:21:52:196]Aqq2
[2025-05-27_11:21:52:196]+CMGL: 4,"REC READ","+3463*******",,"25/05/27,11:18:10+08"
[2025-05-27_11:21:52:216]Fert

[2025-05-27_11:21:52:216]OK
[2025-05-27_11:21:56:393]AT+CMGL="ALL"

[2025-05-27_11:21:56:428]+CMGL: 0,"REC READ","+3463*******",,"25/05/27,11:21:06+08"
[2025-05-27_11:21:56:428]Grrt
[2025-05-27_11:21:56:428]+CMGL: 1,"REC READ","+3463*******",,"25/05/27,11:21:51+08"
[2025-05-27_11:21:56:428]Sdf
[2025-05-27_11:21:56:428]+CMGL: 3,"REC READ","+3463*******",,"25/05/27,11:17:56+08"
[2025-05-27_11:21:56:428]Aqq2
[2025-05-27_11:21:56:428]+CMGL: 4,"REC READ","+3463*******",,"25/05/27,11:18:10+08"
[2025-05-27_11:21:56:441]Fert

[2025-05-27_11:21:56:441]OK
[2025-05-27_11:23:41:339]AT+CPMS?

[2025-05-27_11:23:41:339]+CPMS: "SM",4,20,"SM",4,20,"SM",4,20

[2025-05-27_11:23:41:339]OK

Regards

The simplest explanation is that the SMS sender has set up the new SMS to replace an older version.

That’s done by setting the PID to a value in the range 0x41 through 0x47 (other things being equal).

In that case an existing SMS with the same PID and sender details will be overwritten.

3GPP 23.040, section 9.2.3.9 refers.

Listing the received SMSs in PDU-mode allows examination of the PID and address details:

AT+CMGF=0
AT+CMGL=4