The only time I've ever encountered something remotely like that bug is via Action Replay quirks. For example, there was an old code I used to use to check IVs that altered the number of items in my bag. The quantity of the first TM in my bag would be my HP IV, the second TM would be the Atk IV, and so on. So, if my Pokemon's IVs were 31/31/12/31/7/19, then my TM pocket would look like this:
TM01 x31 (HP)
TM02 x31 (ATK)
TM03 x12 (DEF)
TM04 x31 (SPEED)
TM05 x7 (SPATK)
TM06 x19 (SPDEF)
TM07 x2
TM08 x3
...and so on, with the remaining TMs in the bag having an unmodified quantity.
Things would fuck up a bit of one of the IVs in question was zero, though. It would truncate the item list at that point and not display the remaining items in the bag. So, if the previous example had a DEF IV of zero instead of 12, my TM pocket would look like this:
TM01 x31
TM02 x31
End of list.
The remaining items after TM03 would still be there (verified after changing TM03's quantity to a non-zero number), but they would not be listed in the inventory until I fixed TM03.
Not sure if something similar has happened to your game, where there is an item technically listed in your front pocket but accompanied by a quantity of zero.