I believe you have the same issue as I did. Manipulating any layer property might be a have some unexpected behaviour. For context, go through this topic, but solution for me was this post:
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Select_layername is it corect? | 4 | 319 | May 18, 2023 | |
| [Bug] Changing layer name, changes layer to visible | 28 | 2894 | April 23, 2024 | |
| How to select a layer? | 3 | 1221 | March 11, 2025 | |
| BEFORE_AFTER_Show_Hide not worke true in photoshop | 10 | 374 | May 19, 2023 | |
| Cannot enable/disable layers. Nudging layer moves selected layer not layer variable | 8 | 432 | April 15, 2021 |