An ignition switch turns the power on to the fuel pump and ignition coils of your car before starting it so when an ignition switch goes bad or fails it can cause a cars engine to die due to shutting the fuel off or the electricity to the coils off.
When you turn your key in the vehicle to the off position it turns the cars engine off so if part of the ignition switch fails and it's the part that turns the car off then yes your engine can shut off.