[Bug] layer.moveAbove group

Hi, I use moveAbove method to place a layer above another layer.
But I’ve faced a case when this method doesn’t work as expected.
If I try to move the layer which is located on top of the hierarchy above the group which is located inside the other group. Layer will be moved inside group, not above it.
I’ve created a minimal sample to reproduce this issue:
On the screenshot you can see layer with name LayerToMove which I want to move above the ActualLocation group.


To move the layer, I use the following simple code:

const app = require('photoshop').app;
const {executeAsModal} = require("photoshop").core;
executeAsModal(() => app.activeDocument.layers[0].moveAbove(app.activeDocument.layers[1].layers[0]), {})

But after executing the code, the layer moves inside the ActualLocation group, not above it.


Looks like a bug, or am I doing something wrong?
This issue reproduces only if moving layer is located on top of the hierarchy, in other cases moveAbove works as expected.

What happens if instead of defining the layer to move above like you are doing, you use the selected layer?

Same issue if I am doing like this:

app.activeDocument.activeLayers[0].moveAbove(app.activeDocument.layers[1].layers[0])