Why do electronics have to be off before engine startup/shut down on a Cessna 172?
You shut the components off to protect the sensitive electronics from electrical surges that may occur during start up of the engine.
Circuit breakers are designed to trip open if too much current in amps is drawn from the power source by the electrical components or a short circuit downstream of the circuit breaker. They do not necessarily protect the components from too much amperage and/or voltage generated and pushed through the circuit breaker from upstream of the circuit breaker.
To be safe, disconnecting the components from the power source via a physical switch that can be opened Is prudent to mitigate the risk.