I suspect you are refering to the endpoint /api/cluster/v1/tokens
You are not doing anything wrong. It's just not all the tokens have names set. For instance, a token that is not created by user but by the installer or a backend.
Take a closer look at the results. I'm sure you will find user-generated tokens with names.