Repository: godot
Issue: Error buffer_update: Attempted to write buffer (24576 bytes) past the end
Labels: bug,topic:rendering,needs testing

### Godot version

4.0.3 RC1 or before

### System information

Win10

### Issue description

E 0:00:02:0352   buffer_update: Attempted to write buffer (24576 bytes) past the end.
  <C++ 错误>       Condition "p_offset + p_size > buffer->size" is true. Returning: ERR_INVALID_PARAMETER
  <C++ 源文件>      drivers/vulkan/rendering_device_vulkan.cpp:5872 @ buffer_update()


### Steps to reproduce

step 1：Create project
step 2：Create 3d tscn like this，
sky Environment use The default
----------------------------------------------------------------------

```ini
[gd_scene load_steps=8 format=3 uid="uid://1uwx4f0endol"]

[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_jb3vd"]
sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)
ground_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)

[sub_resource type="Sky" id="Sky_gw5em"]
sky_material = SubResource("ProceduralSkyMaterial_jb3vd")

[sub_resource type="Environment" id="Environment_xt1bg"]
background_mode = 2
sky = SubResource("Sky_gw5em")
tonemap_mode = 2
glow_enabled = true

[sub_resource type="PlaneMesh" id="PlaneMesh_ps2qp"]
size = Vector2(20, 20)

[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_2jdsh"]

[sub_resource type="BoxMesh" id="BoxMesh_7158e"]

[sub_resource type="BoxShape3D" id="BoxShape3D_akki5"]

[node name="Test" type="Node3D"]

[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_xt1bg")

[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.866025, -0.433013, 0.25, 0, 0.5, 0.866025, -0.5, 0.75, -0.433013, 0, 0, 0)
shadow_enabled = true

[node name="StaticBody3D" type="StaticBody3D" parent="."]
collision_layer = 2
collision_mask = 0

[node name="MeshInstance3D" type="MeshInstance3D" parent="StaticBody3D"]
mesh = SubResource("PlaneMesh_ps2qp")

[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
shape = SubResource("WorldBoundaryShape3D_2jdsh")

[node name="RigidBody3D" type="RigidBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.9855, 0)
collision_mask = 7

[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidBody3D"]
mesh = SubResource("BoxMesh_7158e")

[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
shape = SubResource("BoxShape3D_akki5")

[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(0.877583, -0.229849, 0.420736, 0, 0.877583, 0.479426, -0.479426, -0.420736, 0.770151, 2.28865, 2.60791, 4.18935)
```

---------------------------------------------------------------
step 3：set project setting taa open
project.godot like this
--------------------------------------------------------------

```ini
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
;   [section] ; section goes between []
;   param=value ; assign values to parameters

config_version=5

[application]

config/name="MiniGodot"
config/features=PackedStringArray("4.0", "Forward Plus")
config/icon="res://icon.svg"

[rendering]

anti_aliasing/quality/use_taa=true
```

---------------------------------------------------------------------------
step 4：open debug menu---Open the collision area
step 5：F6 this Scene  you will see

```
E 0:00:02:0352   buffer_update: Attempted to write buffer (24576 bytes) past the end.
  <C++ 错误>       Condition "p_offset + p_size > buffer->size" is true. Returning: ERR_INVALID_PARAMETER
  <C++ 源文件>      drivers/vulkan/rendering_device_vulkan.cpp:5872 @ buffer_update()
```


### Minimal reproduction project

see 
[MiniGodot.zip](https://github.com/godotengine/godot/files/11437314/MiniGodot.zip)