Those sensors are surprisingly simple. You have a connector with voltage, signal, and common, and it leads into a microswitch with normally open, normally closed, and common. The sensor signal is activated when the switch arm lifts causing the switch to go from normally closed to open.
So look at the sensor you bought and compare its PCB traces to the sensor that Anycubic uses. (Anycubic's sensor is labeled "VSC" on the back of the sensor's PCB and NC, NO, and C on the mini switch) My guess is that the sensor you purchased is either a normally open sensor or the signal/voltage/common wires aren't in the same configuration as the original.
Both of these situations are easy to fix.
If the switch is normally open then you just need to buy a sensor that is normally closed and make sure the plug matches the Anycubic configuration.
If the sensor is normally open and the signal/voltage/common of the plug don't match, then you'll need to swap wires at the connector. You can either build a jumper connector or reconfigure the wires in the current one. They're just cheap JST connectors so they should come apart with a little bit of effort.
Here's a sensor that might work -- compare the customer images with the Anycubic PCB and see if they match up.