Okay, so here is the log from my shop, starts from the bottom:
[00:03:24] [main/INFO]: [CHAT] Chest accesses from player Andykicks16 in the last 10080 minutes within 30 blocks of location in Simplex_nether:
[00:03:24] [main/INFO]: [CHAT] (1) 05-16 22:16:31 Andykicks16 took 1x enchanted book from trapped chest at 1066:128:236
[00:03:24] [main/INFO]: [CHAT] (2) 05-16 22:16:30 Andykicks16 put 4x diamond into trapped chest at 1066:131:236
[00:03:24] [main/INFO]: [CHAT] (3) 05-14 22:49:57 Andykicks16 took 1152x stone brick from trapped chest at 1060:128:246
[00:03:24] [main/INFO]: [CHAT] (4) 05-14 22:49:45 Andykicks16 put 2x diamond into trapped chest at 1060:131:247
[00:03:24] [main/INFO]: [CHAT] (5) 05-14 21:55:36 Andykicks16 put 2x diamond into chest at 1059:131:236
[00:03:24] [main/INFO]: [CHAT] (6) 05-14 21:55:35 Andykicks16 took 1x enchanted book from chest at 1059:128:236
[00:03:24] [main/INFO]: [CHAT] (7) 05-13 18:32:15 Andykicks16 took 1x enchanted book from chest at 1071:128:236
[00:03:24] [main/INFO]: [CHAT] (8) 05-13 18:32:13 Andykicks16 took 1x enchanted book from trapped chest at 1072:128:236
[00:03:24] [main/INFO]: [CHAT] (9) 05-13 18:32:07 Andykicks16 took 1x rotten flesh from chest at 1057:131:236
[00:03:24] [main/INFO]: [CHAT] (10) 05-13 18:31:03 Andykicks16 took 2x rotten flesh from chest at 1057:131:236
[00:03:24] [main/INFO]: [CHAT] (11) 05-13 18:30:48 Andykicks16 put 3x rotten flesh into chest at 1057:131:236
[00:03:24] [main/INFO]: [CHAT] (12) 05-13 18:30:40 Andykicks16 took 1x enchanted book from chest at 1057:128:236
[00:03:24] [main/INFO]: [CHAT] (13) 05-13 18:07:49 Andykicks16 took 4x diamond from trapped chest at 1058:131:236
[00:03:24] [main/INFO]: [CHAT] (14) 05-13 18:05:35 Andykicks16 put 4x diamond into trapped chest at 1058:131:236
[00:03:24] [main/INFO]: [CHAT] (15) 05-13 18:05:29 Andykicks16 took 1x enchanted book from trapped chest at 1058:128:236
You start out with taking a book and paying for it in top chest, then you take the payment out again.
Then you take another book, put rotten flesh in the payment chest, before taking out the rotten flesh again.
Then you just take two books from two chests, followed buy buying a book legit from another chest.
You moved to the other row where you took out 18 stacks of stonebricks, paying 4D for it, which is actually 0.4 diamonds more than it costs.
And then before you left you bought another book legit.
For me, this doesn't really sounds like just underpaying or miscounting. You just took several books without any payment at all, and also took some payment out of the chests again.