### Godot version

Godot 4 stable and Godot 3.x LTS

### System information

Fedora linux

### Issue description

If you use some custom logic inside _integrate_forces() to alter the state linear velocity and there is any reference to linear_velocity in physics process, the result in godot 3.5 is that it moves just a little bit, while in godot 4 is totally still.

### Steps to reproduce

For the example i created a simple scene in which i apply a force on the linear velocity in  _integrate_forces()  and added a line that add zero to it in physics process. You will not see any move, but it will work fine if you comment the line adding zero.


### Minimal reproduction project

[PhysicsBugReproduction.zip](https://github.com/godotengine/godot/files/12139772/PhysicsBugReproduction.zip)

if (motion_results.size() == 0) {
		return Ref<KinematicCollision2D>();
	}
	return _get_slide_collision(motion_results.size() - 1);
}
void CharacterBody2D::set_safe_margin(real_t p_margin) {
	margin = p_margin;
}
real_t CharacterBody2D::get_safe_margin() const {
	return margin;
}
bool CharacterBody2D::is__stop_on_slope_enabled() const {
	return _stop_on_slope;
}
void CharacterBody2D::set__stop_on_slope_enabled(bool p_enabled) {
	_stop_on_slope = p_enabled;
}
bool CharacterBody2D::is__constant_speed_enabled() const {
	return _constant_speed;
}
void CharacterBody2D::set__constant_speed_enabled(bool p_enabled) {