They only think they know what the item's function is
The DMG's rules on identifying a magic item (p. 136) point out that the characters will know whether something is a magic item to begin with just by handling it. It then specifies three ways for them to learn what a magic item does:
- Casting the identify spell
- Focus on the item while in physical contact during a short rest
- Experimenting or examining the item for clues (like command words)
The third point covers ways to discern properties without needing to spend a short rest or a spell. Here is the example given:
Wearing or experimenting with an item can also offer hints about its properties. For example, if a character puts on a ring of jumping, you could say, “Your steps feel strangely springy.” Perhaps the character then jumps up and down to see what happens. You then say the character jumps unexpectedly high.
This description makes it clear that you can try to understand what an item does based on information you have about it, but you will only know once you confirm that it works that way by trying to use it that way.
If a vendor told them the command word, or told them the function of an item that does not require attunement, and they believe him, they may think it works like that. There is nothing in the description that says they would feel anything if the item worked differently from what the vendor told them. To confirm or refute how it works, they would need to activate or use it to see if it behaves as he told them.
If it was a consumable item, then of course trying so could mean using up the item. In the case of potions, they could confirm what they have with just a little taste instead (as stated in another part of the same section of the DMG). For a spell scroll, a character who has the spell on their spell list can read it. But for other kinds of consumable magic items, they might end up using what they think is a dust of disappearance, only to discover it actually was a dust of sneezing and choking. The way to avoid this would be to spend a short rest or cast the identify spell to actually know what the item does.
PS: If the item requires attunement before it can be used, they will need to spend a short rest or cast identify before they can attune to it – as they cannot try it out to confirm what it does beforehand, and they need to know (not think they know) what it does to attune.
And if the item is cursed (like a potion of poison), then there is typically no way, not even with identify, to find out what it does beforehand.