Buzzer circuit problem in Proteus
A passive piezoelectric buzzer is a capacitor. It will never work on DC voltage. Neither 5V nor 24V. The AC voltage must be controlled from two outputs by push-pull control. Or do the same with an external inverter. The frequency must match the value specified for the beep (eg. 3 kHz). An active (eg. electromechanical) buzzer requires a supply voltage.  First, the type of buzzer should be clarified for a solution.