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

CCD_MODE_DISABLED,
		CCD_MODE_CAST_RAY,
		CCD_MODE_CAST_SHAPE,
	};
private:
	bool can_sleep = true;
	bool lock_rotation = false;
	bool freeze = false;
	FreezeMode freeze_mode = FREEZE_MODE_STATIC;
	real_t mass = 1.0;
	real_t inertia = 0.0;
	CenterOfMassMode center_of_mass_mode = CENTER_OF_MASS_MODE_AUTO;
	Vector2 center_of_mass;
	Ref<PhysicsMaterial> physics_material_override;
	real_t gravity_scale = 1.0;
	DampMode linear_damp_mode = DAMP_MODE_COMBINE;
	DampMode angular_damp_mode = DAMP_MODE_COMBINE;
	real_t linear_damp = 0.0;
	real_t angular_damp = 0.0;
	Vector2 linear_velocity;
	real_t angular_velocity = 0.0;
	bool sleeping = false;
	int max_contacts_reported = 0;
	bool custom_integrator = false;
	CCDMode ccd_mode = CCD_MODE_DISABLED;
	struct ShapePair {
		int body_shape = 0;
		int local_shape = 0;
		bool tagged = false;
		bool operator<(const ShapePair &p_sp) const {