Delete nodes from BST

I am unable to figure out why only the first test case is passing and not the rest.
Here’s my code