### 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)

glBindBuffer(GL_ARRAY_BUFFER, 0);
	
	glBindBuffer(GL_ARRAY_BUFFER, p_mi->mesh->surfaces[p_surface]->skin_buffer);
	bool use_8_weights = p_mi->surfaces[p_surface].format_cache & RS::ARRAY_FLAG_USE_8_BONE_WEIGHTS;
	int skin_stride = sizeof(int16_t) * (use_8_weights ? 16 : 8);
	glEnableVertexAttribArray(RS::ARRAY_BONES);
	glVertexAttribIPointer(RS::ARRAY_BONES, 4, GL_UNSIGNED_SHORT, skin_stride, CAST_INT_TO_UCHAR_PTR(0));
	if (use_8_weights) {
		glEnableVertexAttribArray(11);
		glVertexAttribIPointer(11, 4, GL_UNSIGNED_SHORT, skin_stride, CAST_INT_TO_UCHAR_PTR(4 * sizeof(uint16_t)));
		glEnableVertexAttribArray(12);
		glVertexAttribPointer(12, 4, GL_UNSIGNED_SHORT, GL_TRUE, skin_stride, CAST_INT_TO_UCHAR_PTR(8 * sizeof(uint16_t)));
		glEnableVertexAttribArray(13);
		glVertexAttribPointer(13, 4, GL_UNSIGNED_SHORT, GL_TRUE, skin_stride, CAST_INT_TO_UCHAR_PTR(12 * sizeof(uint16_t)));
	} else {
		glEnableVertexAttribArray(RS::ARRAY_WEIGHTS);
		glVertexAttribPointer(RS::ARRAY_WEIGHTS, 4, GL_UNSIGNED_SHORT, GL_TRUE, skin_stride, CAST_INT_TO_UCHAR_PTR(4 * sizeof(uint16_t)));
	}
	glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, p_mi->surfaces[p_surface].vertex_buffer);
	glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D, p_sk->transforms_texture);
	glBeginTransformFeedback(GL_POINTS);
	glDrawArrays(GL_POINTS, 0, p_mi->mesh->surfaces[p_surface]->vertex_count);
	glEndTransformFeedback();
	glDisableVertexAttribArray(RS::ARRAY_BONES);
	glDisableVertexAttribArray(RS::ARRAY_WEIGHTS);
	glDisableVertexAttribArray(RS::ARRAY_BONES + 2);
	glDisableVertexAttribArray(RS::ARRAY_WEIGHTS + 2);
	glBindVertexArray(0);
	glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, 0);