Group lights inconsistent

I am new to Home Assistant and so far its going well. I do have a question regarding automation to a group of lights. It is working but sometimes it does not apply to everything in the group. Below is what I am using right now, but is there something to use? I have seen the use of before and after and at time but so far can not find any descriptions of one method vs another other other than others peoples samples.

I should also add that I am using this from a raspberry pi, with a aeotec stick and 2 aeotec outlet switches.

automation:
- alias: '1 Lights on 4pm'
  trigger:
    platform: time
    hours: 16
    minutes: 0
    seconds: 0
  action:
    service: homeassistant.turn_on
    entity_id: group.name

- alias: '2 Lights off 22pm'
  trigger:
    platform: time
    hours: 22
    minutes: 0
    seconds: 0
  action:
    service: homeassistant.turn_off
    entity_id: group.name