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

bool is_on_wall() const;
	bool is_on_wall_only() const;
	bool is_on_ceiling() const;
	bool is_on_ceiling_only() const;
	const Vector2 &get_last_motion() const;
	Vector2 get_position_delta() const;
	const Vector2 &get_floor_normal() const;
	const Vector2 &get_wall_normal() const;
	const Vector2 &get_real_velocity() const;
	real_t get_floor_angle(const Vector2 &p_up_direction = Vector2(0.0, -1.0)) const;
	const Vector2 &get_platform_velocity() const;
	int get_slide_collision_count() const;
	PhysicsServer2D::MotionResult get_slide_collision(int p_bounce) const;
	CharacterBody2D();
	~CharacterBody2D();
private:
	real_t margin = 0.08;
	MotionMode motion_mode = MOTION_MODE_GROUNDED;
	PlatformOnLeave platform_on_leave = PLATFORM_ON_LEAVE_ADD_VELOCITY;
	bool floor_constant_speed = false;
	bool floor_stop_on_slope = true;
	bool floor_block_on_wall = true;
	bool slide_on_ceiling = true;
	int max_slides = 4;
	int platform_layer = 0;
	real_t floor_max_angle = Math::deg_to_rad((real_t)45.0);
	real_t floor_snap_length = 1;
	real_t wall_min_slide_angle = Math::deg_to_rad((real_t)15.0);
	Vector2 up_direction = Vector2(0.0, -1.0);
	uint32_t platform_floor_layers = UINT32_MAX;