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

_constant_speed = p_enabled;
}
bool CharacterBody2D::is__block_on_wall_enabled() const {
	return _block_on_wall;
}
void CharacterBody2D::set__block_on_wall_enabled(bool p_enabled) {
	_block_on_wall = p_enabled;
}
bool CharacterBody2D::is_slide_on__enabled() const {
	return slide_on_;
}
void CharacterBody2D::set_slide_on__enabled(bool p_enabled) {
	slide_on_ = p_enabled;
}
uint32_t CharacterBody2D::get_platform__layers() const {
	return platform__layers;
}
void CharacterBody2D::set_platform__layers(uint32_t p_exclude_layers) {
	platform__layers = p_exclude_layers;
}
uint32_t CharacterBody2D::get_platform_wall_layers() const {
	return platform_wall_layers;
}
void CharacterBody2D::set_platform_wall_layers(uint32_t p_exclude_layers) {
	platform_wall_layers = p_exclude_layers;
}
void CharacterBody2D::set_motion_mode(MotionMode p_mode) {
	motion_mode = p_mode;
}
CharacterBody2D::MotionMode CharacterBody2D::get_motion_mode() const {