The code executed successfully but while running in proteus, after giving the inputs neither the motor is turning on nor the bulb. I have attached the screenshots of simulation as well as the error and my source window and also the proteus zipped.
You are using 12V relays but you are powering them with 5V, they won’t work. If you use a 12V relay, you must power it with 12V, a 5V relay must be powered with 5V. If you change the relay voltage to 5V it will work because they are connected to 5V.