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

return motion_mode;
}
void CharacterBody2D::set_platform_on_leave(PlatformOnLeave p_on_leave_apply_velocity) {
	platform_on_leave = p_on_leave_apply_velocity;
}
CharacterBody2D::PlatformOnLeave CharacterBody2D::get_platform_on_leave() const {
	return platform_on_leave;
}
int CharacterBody2D::get_max_slides() const {
	return max_slides;
}
void CharacterBody2D::set_max_slides(int p_max_slides) {
	ERR_FAIL_COND(p_max_slides < 1);
	max_slides = p_max_slides;
}
real_t CharacterBody2D::get__max_angle() const {
	return _max_angle;
}
void CharacterBody2D::set__max_angle(real_t p_radians) {
	_max_angle = p_radians;
}
real_t CharacterBody2D::get__snap_length() {
	return _snap_length;
}
void CharacterBody2D::set__snap_length(real_t p__snap_length) {
	ERR_FAIL_COND(p__snap_length < 0);
	_snap_length = p__snap_length;
}
real_t CharacterBody2D::get_wall_min_slide_angle() const {