Please follow the Community Questions Guidelines by providing the properly formatted configuration of the automation you are asking about.
My first guess from the limited information provided is that you are using the wrong action. To control both light and switch entities in the same action you need to use the generic actions homeassistant.turn_on and homeassistant.turn_off