### Godot version

v4.0.beta14.official [28a24639c]

### System information

Windows 10, OpenGL

### Issue description

Vulkan and Mobile:
![Godot_v4 0-beta14_win64_kEcRNiMfNJ](https://user-images.githubusercontent.com/7782218/213967627-8e8755d9-2fe2-43b3-b197-f9f2840b7580.gif)

OpenGL:
![Godot_v4 0-beta14_win64_MQ233TZuPq](https://user-images.githubusercontent.com/7782218/213967651-ae463a6f-c867-4312-bdf1-525e1d7def01.gif)

At first I thought it was related to `set_buffer()`, but it turned out that `set_instance_*` also work incorrectly.
Probably the custom information is also set incorrectly, but I haven't checked it yet.

### Steps to reproduce

* Open MRP
* In the editor, select `MeshInstance3D` node and change the `Count` property
* -- or --
* Start the project and move the slider

You can also switch the renderer to Vulkan and compare.

### Minimal reproduction project

[set_buffer().zip](https://github.com/godotengine/godot/files/10476834/set_buffer.zip)

for (int i = 0; i < multimesh->instances; i++) {
			{
				float *dataptr = w + i * old_stride;
				float *newptr = w + i * multimesh->stride_cache;
				float vals[8] = { dataptr[0], dataptr[1], dataptr[2], dataptr[3], dataptr[4], dataptr[5], dataptr[6], dataptr[7] };
				memcpy(newptr, vals, 8 * 4);
			}
			if (multimesh->xform_format == RS::MULTIMESH_TRANSFORM_3D) {
				float *dataptr = w + i * old_stride + 8;
				float *newptr = w + i * multimesh->stride_cache + 8;
				float vals[8] = { dataptr[0], dataptr[1], dataptr[2], dataptr[3] };
				memcpy(newptr, vals, 4 * 4);
			}
			if (multimesh->uses_colors) {
				float *dataptr = w + i * old_stride + (multimesh->xform_format == RS::MULTIMESH_TRANSFORM_2D ? 8 : 12);
				float *newptr = w + i * multimesh->stride_cache + multimesh->color_offset_cache;
				uint16_t val[4] = { Math::make_half_float(dataptr[0]), Math::make_half_float(dataptr[1]), Math::make_half_float(dataptr[2]), Math::make_half_float(dataptr[3]) };
				memcpy(newptr, val, 2 * 4);
			}
			if (multimesh->uses_custom_data) {
				float *dataptr = w + i * old_stride + (multimesh->xform_format == RS::MULTIMESH_TRANSFORM_2D ? 8 : 12) + (multimesh->uses_colors ? 4 : 0);
				float *newptr = w + i * multimesh->stride_cache + multimesh->custom_data_offset_cache;
				uint16_t val[4] = { Math::make_half_float(dataptr[0]), Math::make_half_float(dataptr[1]), Math::make_half_float(dataptr[2]), Math::make_half_float(dataptr[3]) };
				memcpy(newptr, val, 2 * 4);
			}
		}
		multimesh->data_cache.resize(multimesh->instances * (int)multimesh->stride_cache);
		const float *r = multimesh->data_cache.ptr();
		glBindBuffer(GL_ARRAY_BUFFER, multimesh->buffer);
		glBufferData(GL_ARRAY_BUFFER, multimesh->data_cache.size() * sizeof(float), r, GL_STATIC_DRAW);