Your Core Query is Basically this :
Is it Correct/valid to "Prove" $X \land Z \equiv Y \land Z$ by Proving $X \equiv Y$ , ignoring the Common $Z$ ?
Answer : No
Here are 2-3 ways to look at it , to get Intuition , which will then let us analyse your Specific Case at the End :
(A) In terms of Equations with Integers :
Proving $ax=bx$ (where $a$ & $b$ are Arbitrarily Complicated Expressions) may be done with Proving $a=b$ , but these two may not be Equal in the given Scenario: It may be that $x=0$ & we can never Prove that $a=b$ , though we can Prove the overall $ax=bx$
(B) In terms of Matrix Equations :
We may be given to Prove $AC=BC$ , but that gives $(A-B)C=0$ where we can neither conclude that $C=0$ nor conclude that $A-B=0$ (which is $A=B$) : Here too , we can not ignore the Common $C$ , & we have to show the overall Equality.
(C) In terms of Mathematical Logic :
In $X \land Z \equiv Y \land Z$ , where each term is some logical Expression with some "logical variables" , it might be that :
(C1) With certain values of the "logical variables" , $X \equiv Y$ & overall , it is true
(C2) With certain other values of those "logical variables" , $X \not \equiv Y$ , but in those cases $Z=0$ , hence overall , it is true.
In that Scenario , we may never be able to Prove $X \equiv Y$ (because it is not true) , though $X \land Z \equiv Y \land Z$ is true.
(D) In terms of your given Example :
It is not true.
When $\lnot c$ is true , it becomes $0 \equiv 0$ , which is Entirely true , Independent of $a$ & $b$ !
In that Case , we can see that your Simplified Expression Depends on $a$ & $b$ !
Hence , these 2 can not be logically Equivalent.