First recognising that the sections of 2 Samuel 21-24 are arranged chiastically is attributed to Karle Budde in 1902.
A: Israel suffer famine because Saul has killed the Gibeonites – Saul’s sons executed (21:1-14)
B: David’s mighty men kill Goliath’s sons (21:15-22)
C: David’s song of deliverance from his enemies (22:1-51)
C’: David’s last words as the sweet psalmist of Israel (23:1-7)
B’: David’s mighty men and their deeds (23:8-38)
A’: Israel suffer pestilence because David numbered the people (24:1-25)
Joyce Baldwin has the following in her commentary:
The six episodes here form a concentric pattern (A, B, C, C1, B1, A1) with poems written by the king at the centre, on either side an account of great warriors who served the king, and at the beginning and end natural disasters which struck during David’s reign.
In a skilful way, these chapters summarize what has gone before, yet without mere repetition. At a deeper level, they present Israel’s greatest king as a man who both inherited problems from his predecessor and created them himself (A, A1); who fought and achieved his victories with the help of many others who are celebrated here (B, B1), and whose joy and strength was his God, whom he praised with total abandon because everything he was and everything he had achieved was to be attributed to the faithful Lord God of Israel (C, C1).
I found the following helpful – published by Grace Ko – “2 Samuel 21-24: A theological reflection on Israel’s kingship”, OTE 31/1 (2018): 114-134.
https://doi.org/10.17159/2312-3621/2018/v31n1a7
The author states “The chiastic arrangement of 2 Sam 21-24 signifies that it is not just a collection of miscellaneous material supplementing the Samuel corpus. Rather it is intentionally arranged to function as a theological reflection on Israel’s kingship.”
PDF can be found at https://ote-journal.otwsa-otssa.org.za/index.php/journal/article/view/188