Washer won't drain (not lid switch)

I would suggest replacing the lid switch. The middle wire is the ground connection for the cabinet. Without the lid switch connector plugged in, you won’t have a good cabinet ground which means you have two safety violations. 1) no lid switch, 2) no cabinet ground.

Eric