TL/DR : the circuit seems to be working as intended.
I think you misunderstood the (bad) explanation on the linked page:
Diode D2 which is linked with the switch S2 begin its conduction and
offers power supply the transistor T1 and T2, which is in the waking
state and as a result sound comes from the speaker attached to it. But
in this instance a high frequency tone comes out which is a sign that
there is some intruder present around the locker. The sound that came
from the speaker can only be stopped by cut off the power supply.
"... switch S2 ... offers power supply the transistor T1..."
actually S2 provides base current to T1, the "power supply" is permanently connected to T2 and other components. That being so, it's easier to understand "stopped by cut off the power supply" to mean, stopped by cutting off T1's base current - i.e. releasing the switch.
There would need to be some other arrangement to supply T1 base current, perhaps driven from the oscillation, or a separate latch also triggered from the switch, for the buzzer to continue until power was removed.