If the first trade of a villager is out of stock, it will show an X when first opening the villager trading UI
If you use up a villager's first trade slot, you will see an "x" as soon as you open the villager trading UI and it won't go away until you click another trade.