Axiom of extensionality looks like this:
$\forall{A,B}:(\forall{X}:(X \in A \iff X \in B) \implies A=B)$
Now set $A= \emptyset=\{\forall{Y}:\lnot(Y \in A)\}$ (axiom of the empty set)
Now look at all sentences produced by our Axiom of extensionality that uses the empty set.
$\forall{B}:(\forall{X}:(X \in \emptyset \iff X \in B) \implies \emptyset=B)$
But $X \in \emptyset $ is always $false$ for every $X$, it follows $X \in B$ is $false$ (exception later)
That means $\forall{X}:(X \in \emptyset \iff X \in B)$ is always $true$
Now the Implication $A\implies B$ is $true\iff A=true \land B=true$
and $false \iff A=true \land B=false$ (Rule of Implication)
We know that $\forall{X}:(X \in \emptyset \iff X \in B)$ is $true$ and that implies that $\emptyset=B$.
$\forall{B}:(\forall{X}:(X \in \emptyset \iff X \in B) \implies \emptyset=B)$ is $true$ when $B=\emptyset$, but tricky to resolve when $B \neq \emptyset$, because imagine $B \neq \emptyset$, then we have:
$\forall{B}:(\forall{X}:(X \in \emptyset \iff X \in B) \implies \emptyset=B)$
We know for a fact $\emptyset=B$ is false, but $\forall{X}:(X \in \emptyset \iff X \in B)$ is tricky to resolve when $B \neq \emptyset$, because:
$X \in \emptyset$ is false for every $X$ but $X \in B$ is at least true in some scenarios, because we choose $B \neq \emptyset$. In all those scenarious, the axiom
$\forall{A,B}:(\forall{X}:(X \in A \iff X \in B) \implies A=B)$
produce Implication of the form: $A \implies B$, where A and B are false, but the whole sentence is true and A=true and B=false, so the whole sentence is false.
This proofs the inconsistency of the Axiom of extensionality with the axiom of the empty set
Example:
$A=\emptyset$
$B=\{1,2,3\}$
$\forall{X}:(X \in \emptyset \iff X \in \{1,2,3\}) \implies \emptyset=\{1,2,3\})$
$1 \in \emptyset \iff 1 \in \{1,2,3\})$ =wrong $\implies \emptyset=\{1,2,3\})$ =wrong OR true, that means the whole sentence true (vacuous truth)
$2 \in \emptyset \iff 2 \in \{1,2,3\})$ same here
$3 \in \emptyset \iff 3 \in \{1,2,3\})$ same here
$4 \in \emptyset \iff 4 \in \{1,2,3\})$ =true $\implies \emptyset=\{1,2,3\})$ =wrong OR false, that means the whole sentence is undecidable, but bexause the sentence is an axiom, it must be true and there fore if the first term is true it must be implied that $\implies \emptyset=\{1,2,3\})$ is also true.
So the axiom of extensionality produces true sentences for some picks for A and B, especially if we pick $A=\emptyset$ and $B\neq \emptyset$, but it's not clear wether or not $\emptyset=\{1,2,3\})$
We could formulate it like this: If we ask the question: Is the sentence $\emptyset=\{1,2,3\})$ $true$ or $false$ from the perspective of the axioms. If you try the numbers 1,2,3 for X, then you get a sentence which is true, and the subsentence $\emptyset=\{1,2,3\})$ can be false or true. We can't know that.
But if we ask the question: Is the sentence $\emptyset=\{1,2,3\})$ $true$ or $false$ from the perspective of the axioms and we try every other element (except 1,2,3) for X, then the sentence is true or false, but because it's an axiom, it mus be true, therefore, because $4 \in \emptyset \iff 4 \in \{1,2,3\})$ is true the subsentence $\emptyset=\{1,2,3\})$ must be true.
But that contradicts the axiom of the empty set.
Where is the mistake?
This is where you went wrong. What this says is that $\textbf{if}$ $X\in B$ is false $\forall X$, then $\varnothing=B$. This creates no contradiction.