Found a bizarre little bug in 2.50.
If you have a room with a shop (or probably other special room types; only tested this for a shop in a cave, not on the screen), but also have dive->item flags on screen, then it will give you an item when you dive which has the same index no. as the shop you used.
I suspect this effect would also work for potion shops (instead of shops, I mean).
That's not a bug. That's how Special Room Type works.
In ZScript, there is code like this: Screen->RoomData.
This refers to a lot of things.
Such as: Shop Type if a shop.
Item given by a treasure chest/diving in a Special Room.
Etcetera... (there's a much longer list of what that can refer to, but that covers this instance)
So, if you dive in a room that's a shop, it reads Screen->RoomData and thinks that's the item which you should get upon diving.
This is because the same information is used internally to store both.
So, not a bug. Just a little known feature.