Get the layer Name: app.activeDocument.layers is not working as use to

Not sure how it was before, but according to docs

layers: All the layers in the document at the top level

So it looks like you’ll have to recursively get all the tree yourself.
And I don’t see this in changelog