Cognitive phantoms in LLMs through the lens of latent variables