Repository: godot
Issue: Aligning objects to specific normals sets object scale to zero
Labels: discussion,topic:physics,topic:3d

### Tested versions

Reproducible in 4.2.stable and 4.1.1.stable

### System information

Godot v4.2.stable - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1070 (NVIDIA; 31.0.15.3713) - AMD Ryzen 7 2700X Eight-Core Processor (16 Threads)

### Issue description

Aligning object's Y-axis with collision normal results in scale (0, 0, 0) for _specific_ normals

https://github.com/godotengine/godot/assets/46084870/74521573-962c-4ddd-a9fb-fbedcc6a2b40

**Grey mesh (GM)** contains the problematic "back wall" face.
**Red mesh (RM)** works.
**Blue mesh (BM)** works.

**Expected**
Changing the object's alignment from GM "floor" face normal to GM "back wall" face normal should rotate the object as expected and maintain scale of 1.

**Actual**
Changing the object's alignment from GM "floor" face normal to GM "back wall" face normal results in scale of `Vector3.ZERO`.

**Worth Mentioning**
- Setting scale to `Vector3.ONE` after alignment reveals the transform is aligned with initial rotation
- Alignment from **GM** "floor" face to **BM** face works
- Alignment from **GM** "floor" face to any **RM** face works
- Alignment from **RM/BM** face to **GM** "back wall" face works. But a subsequent move from **GM** "back wall" to **GM** "floor" face will produce scale `Vector3.ZERO`.
- The working **BM/RM** "back wall" normals show as `(0, -0, 1)`, while the non-working **GM** "back wall" normal shows as `(0, 0, 1)`

**IMPORTANT:** While typing that last point, I came to the realization that the `y` value float in `(0, -0, 1)` is truncated. Printing the `y`-value for the "back wall" normals that align properly results in `-0.0000000437114` for **BM** and `-0.00000005960464` for **RM**. **GM** is simply `0`. All meshes are perfectly aligned in both Blender and Godot, so it seems this discrepancy is occurring elsewhere.

I initially thought the alignment code I'm relying on fails when attempting to align to a perfectly aligned normal, but some of the other normals that alignment works with are perfectly aligned normals 🤔 

### Steps to reproduce


The **grey mesh** (GM) contains the seemingly problematic normals. It was created in blender by scaling a cube, deleting the front face, recalculating normals inside, applying all transforms, and exporting as gltf/glb (collider autogenerated with `-col` suffix). Generating collider separately within Godot makes no difference. Solidifying makes no difference.

![image](https://github.com/godotengine/godot/assets/46084870/69b05ee6-a78d-43dd-8d2e-99fff8f935e0)

The **red mesh** (RM), while seemingly similar, doesn't contain any problematic normals. It was created in blender by rotating a plane 90 degrees on x-axis, extruding front face, deleting front face, recalculating normals inside, applying all transforms, and exporting as gltf/glb (collider auto-generated with `-col` suffix).

![image](https://github.com/godotengine/godot/assets/46084870/13b9d1b7-ab28-49a4-b702-d92f3cf9d186)

The **blue mesh** (BM) is a primitive PlaneMesh made within Godot, collider generated via **Mesh > Create Trimesh Static Body**.

I'm attempting to align an object to a collision normal with the following function:

```gdscript
func align_with_normal(xform: Transform3D, normal: Vector3) -> Transform3D:
	xform.basis.y = normal
	xform.basis.x = -xform.basis.z.cross(normal)
	xform.basis = xform.basis.orthonormalized()
	return xform
```

Example usage:
```gdscript
# debug_mesh.top_level = true
# debug_mesh.position = result.position
# var xform = debug_mesh.transform
# debug_mesh.transform = align_with_normal(xform, result.normal)
# ^^^  doesn't make a difference either way  vvv 
debug_mesh.global_position = result.position
var xform = debug_mesh.global_transform
debug_mesh.global_transform = align_with_normal(xform, result.normal)
```

### Minimal reproduction project (MRP)

[normal_alignment_bug.zip](https://github.com/godotengine/godot/files/13605758/normal_alignment_bug.zip)