### Godot version

4.0beta13

### System information

Windows10, AMD Ryzen 9 3900XT, RTX3070, Vulkan

### Issue description

I would expect when using the scale tool on an object with a scale of (1,1,1) without touching any of the handles to result in a uniform scale again (i.e. 0.1, 0.1, 0.1) and not one, where all components are different.
However, when the object has been rotated, this is the case no matter if using local or global transform.

![RotateAndScaleBroken](https://user-images.githubusercontent.com/53947784/213452728-d03427dd-be89-4bba-8dba-fbade6627555.gif)

This behavior was working properly in 3.x

### Steps to reproduce

- Create an object (e.g. a CSGBox3D)
- Rotate it a little on different axes
- Scale it with the scale tool, without using any handle (uniform scale)
- Observe how the object is now slightly squashed or stretched, i.e. the scale components are not equal anymore

### Minimal reproduction project

[BrokenScale.zip](https://github.com/godotengine/godot/files/10457086/BrokenScale.zip)

Observe how the cube turns into a pillar when using the Scale Manipulator.
t.translate_local(se->aabb.position - offset / 2);
					t.basis = t.basis * aabb_s;
				}
				{
					const Vector3 offset(0.01, 0.01, 0.01);
					Basis aabb_s;
					aabb_s.scale(se->aabb.size + offset);
					t_offset.translate_local(se->aabb.position - offset / 2);
					t_offset.basis = t_offset.basis * aabb_s;
				}
				RenderingServer::get_singleton()->instance_set_transform(se->sbox_instance, t);
				RenderingServer::get_singleton()->instance_set_transform(se->sbox_instance_offset, t_offset);
				RenderingServer::get_singleton()->instance_set_transform(se->sbox_instance_xray, t);
				RenderingServer::get_singleton()->instance_set_transform(se->sbox_instance_xray_offset, t_offset);
			}
			if (changed || (spatial_editor->is_gizmo_visible() && !exist)) {
				spatial_editor->update_transform_gizmo();
			}
			if (message_time > 0) {
				if (message != last_message) {
					surface->queue_redraw();
					last_message = message;
				}
				message_time -= get_physics_process_delta_time();
				if (message_time < 0) {
					surface->queue_redraw();
				}
			}
			bool show_info = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_INFORMATION));
			if (show_info != info_label->is_visible()) {