Repository: godot
Issue: [Godot 4.2] Methods `Control.set_anchor`, `set_offset`, `set_anchor_and_offset` don't work
Labels: needs testing,topic:gui

### Tested versions

- Reproducible: 4.1.stable, 4.2.stable

### System information

Godot v4.2.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 650 (NVIDIA; 30.0.14.7464) - 13th Gen Intel(R) Core(TM) i5-13400 (16 Threads)

### Issue description

If we create a simple Control scene, add 2 Controls and 2 Labels to it.
![image](https://github.com/godotengine/godot/assets/3006659/aab0a92b-cdbf-44bf-bcf8-c7d496d23cb8)
Setup «Layout Mode», «Anchor Preset», «Anchor Points», «Anchor Offsets» for given nodes (Control1, Label1, Control2, Label2):
![image](https://github.com/godotengine/godot/assets/3006659/144f68c2-5a35-4541-9d1b-782f539875a3)
![image](https://github.com/godotengine/godot/assets/3006659/a7cac4d7-c45a-4b43-a817-99d3d4701086)
![image](https://github.com/godotengine/godot/assets/3006659/49e8fcf4-fe2f-42b6-8dd0-a8cb3fb8f3f0)
![image](https://github.com/godotengine/godot/assets/3006659/9ac60e52-2c2e-454d-bd56-15f61b549ca3)
Controls act as expected when window (or parent node) is resized:
![image](https://github.com/godotengine/godot/assets/3006659/bb19c83d-1bf0-43d5-9bcd-19cd9a3ec50e)
![image](https://github.com/godotengine/godot/assets/3006659/46c55771-d1d4-4715-b360-43d25e281210)
But, if we recreate this scene in C++ in GDExtension (in _ready function of Control):
```
Control* control1 = memnew(Control);
control1->set_anchor(SIDE_BOTTOM, 1.0);
control1->set_anchor(SIDE_RIGHT,  0.5);
control1->set_offset(SIDE_BOTTOM, 0.0);
control1->set_offset(SIDE_LEFT,   0.0);
control1->set_offset(SIDE_RIGHT,  0.0);
control1->set_offset(SIDE_TOP,    0.0);
this->add_child(control1);

Label* label1 = memnew(Label);
label1->set_anchor_and_offset(SIDE_BOTTOM, 0.5, 0.0);
label1->set_anchor_and_offset(SIDE_LEFT,   0.5, 0.0);
label1->set_anchor_and_offset(SIDE_RIGHT,  0.5, 0.0);
label1->set_anchor_and_offset(SIDE_TOP,    0.5, 0.0);
label1->set_text("Hello, World!");
control1->add_child(label1);

Control* control2 = memnew(Control);
control2->set_anchor(SIDE_BOTTOM, 1.0);
control2->set_anchor(SIDE_LEFT,   0.5);
control2->set_anchor(SIDE_RIGHT,  1.0);
control1->set_offset(SIDE_BOTTOM, 0.0);
control1->set_offset(SIDE_LEFT,   0.0);
control1->set_offset(SIDE_RIGHT,  0.0);
control1->set_offset(SIDE_TOP,    0.0);
this->add_child(control2);

Label* label2 = memnew(Label);
label2->set_anchors_preset(Control::PRESET_CENTER);
label2->set_offset(SIDE_BOTTOM, 0.0);
label2->set_offset(SIDE_LEFT,   0.0);
label2->set_offset(SIDE_RIGHT,  0.0);
label2->set_offset(SIDE_TOP,    0.0);
label2->set_text("Hello, World!");
control2->add_child(label2);
```
We will see this:
![image](https://github.com/godotengine/godot/assets/3006659/c6f30db9-cab9-4aee-919f-c2893ff5ed4d)
![image](https://github.com/godotengine/godot/assets/3006659/612535e2-2e0f-4ebc-86e4-8d142271a681)
Now we see elements positioned incorrectly and handle resizing more unexpectedly. 

### Steps to reproduce

1. Setup GDExtension working directory from official doc.
2. Extract MRP from «project.zip» give below.

### Minimal reproduction project (MRP)

[project.zip](https://github.com/godotengine/godot/files/13628273/project.zip)