Why do i need an endstop sensor with stepper motor?
Not stupid in the least!

You count the steps from some point where the system initializes to, but how do you know where that starting point is unless you measure it?  You know it pretty well if you are using some sort of ABSOLUTE ENCODER that measures the position from some real reference point, but a stepper motor system may not have any encoder, or it may just have a RELATIVE ENCODER, that tracks changes only from some initial point that could be anywhere.  When such a system turns on, the count is ZERO, regardless of the initial condition, and only changes from that (possibly arbitrary) zero point can be tracked.

Many systems use a control strategy where the motor will move slowly in one direction until it hits some switch, at which point you know for certain that the motor is at the switch!  You then tell the system to return to its operating range, and track the motion from there.

There's also safety.  If overtravel will cause damage to the system or possibly hurt someone, you don't depend on the system to control it correctly in every case, but you put switches in to detect if an overtravel is occurring, and stop the system dead.  You call these switches interlocks, and whether you use them or not depends on how expensive your components are, how difficult they are to replace, whether downtime is critical, or how likely someone is to get hurt.

I don't know what the optical gyroscope is, but maybe its a form of absolute encoder.  Servo systems might have all the same inherent issues, depending on whether they use absolute or relative position encoders.