(The) Lights Are On, But Nobody’s Home

What does the idiom “(The) Lights Are On, But Nobody’s Home” mean?

Definition:

This person appears normal but is deficient in mental functioning, stupid

For example:

“Carl couldn’t even answer basic questions about the budget. With him, sometimes I think the lights are on, but nobody’s home.”