Returning existing layers and layers.length with UXP for Photoshop

If you’ve searched the forum, you would’ve found this topic:

If you read through the topic, you’d find some links and quotes from the docs, that .layers returns only top level layers (in your case it’s only one group layer)