I am not seeing this behaviour that you are reporting. What I am seeing is that the returned value is the total number of keyframes for the objects you pass in as arguments. If you are passing multiple objects, then it is the total for all of them, so you will want to run that for each object individually. When I create a new object, it is zero. When I create a key on tx, it is one. If I created another key on tx at a different time it returns 2. If I hit 's' like you suggested then I am creating keys on all the transform channels which means the first one will be 10. So it is not an attribute count.
I assumed since your stated goal is to check if an object has more than 1 red tick mark. And so checking each object individually, the way I had provided, seems like it does what you want? Technically you could have 100 red tick marks but no value change between them, which means the object is static even though it has keyframes.