Mobs killed statistics (and I imagine other statistics) update after advancement criteria checks, such that you cannot use them for Tracking mob kills.
The advancement should check the players kill count for Elder Guardians every time a monster is killed and trigger once the kill count reaches 3. However, this check happens before the statistic for killing the 3rd Elder Guardian is updated, so will actually trigger on the following entity kill after the player has killed the 3rd Elder Guardian.
- Add the attached data pack to the world
- Kill 3 elder guardians (you need to make sure you haven't done this before in the world)
- The advancement is not granted
- Kill any other mob
- The advancement is granted