What is Leibniz’s law? This:
If a is the same as b, then everything true of a is also true of b.
Or in symbols: (x) (y) (F) (x = y ⊃. F (x) ≡ F (y))
There's at least one way in which it can be taken to be false. Take Roger Scruton’s example:
“Suppose John is thinking tenderly of Mary, and Mary is the person who, unknown to John, ate his beloved cat. Is John thinking tenderly of the person who ate his cat?”
This is primarily a question of John’s beliefs about Mary (de dicto): not about Mary herself (de re). It's indeed the case the cat-eater is the same person as the person thought tenderly of by John. However, John doesn't know that Mary ate his cat. This is a fact about John; not a fact about Mary. (Can there be psychological facts?)... Unless what is thought by other people about Mary also constitute facts about Mary. In that case, there would be a multitude of facts about Mary that she and others (as individuals) couldn't know about Mary (which isn't in itself implausible).
Does this story break Leibniz’s law? No.
What we would require to save the day is a theory of contexts: 'intensional' contexts. Do we need such intensional (or belief contexts) at all? Quine said no – at least not in science, logic and perhaps in philosophy too. That is, what John is thinking of doesn't belong to this particular extension (or reference) – that is, to Mary. Thus it plays no part in science or logic. (Though it would, perhaps, play a part in the psychological descriptions of John.) Then again, it could also be said that Mary (as a single person or human being) couldn't really play a part in science or logic either.