There isn’t anything obviously wrong with your templates. Please post the actual automation (properly formatted) and debug logs so we can see everything in context.
trigger:
- platform: template
value_template: "{{ 66 <= state_attr('fan.fanlinc_51_d1_37_fan', 'percentage') <= 67 }"