Can anyone please help me?

No, there was not a swap of X and Y end stop, however I did replace the actual optical sensor on the daughter card with a new one.

@Ariel_Yahni_UniKpty I don’t think you can swap the x&y daughter cards, can you?
Someone needs to make a replacement for these cards. When they go bad there is no reliable source.

This i not my area of expertise, but 1 ohm for the resistor seems wrong. The test circuit in the datasheet for this sensor has a 50 ohm resistor and in the picture it looks like a 10 ohm? If the resistor were bad it could damage the led in the sensor. Can you shine or reflect a light into the receiving end of the sensor to get an output voltage lower than 2.5v?

Ok I missed that. I missed the decimal point and thought it said 1004 ohms. It should be 1000 ohms. So does it really read 1.004 ohms or is the meter on 1k scale.
A 1ohm resister will burn out the sensors transmitter and it would have never worked?

the resistor should be brown-black-red.