I have a strange problem with the Google Sheets QUERY function and COUNT. I made an easy example to show the problem:
https://docs.google.com/spreadsheets/d/1wA5c-1NYpKZ58d6It728EGbTCeRfEzXd_JXN02U0odg/edit?usp=sharing
When there is no date (01.01.2021) in the data, everything works fine. If there is a date in the data the QUERY function stops working/counting. It starts counting again below the date.
/EDIT: Screenshots:
No date, works fine

Function (red cell):
=query(A2:C5;"SELECT COUNT(A) WHERE A='a' AND C='Yes' LABEL COUNT(A)''")
With date, stops working

Function (red cell):
=query(A9:C12;"SELECT COUNT(A) WHERE A='a' AND C='Yes' LABEL COUNT(A)''")
Still counts below the date

Function (red cell):
=query(A16:C19;"SELECT COUNT(A) WHERE A='b' AND C='Yes' LABEL COUNT(A)''")