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

ADD_GROUP("Floor", "_");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "_stop_on_slope"), "set__stop_on_slope_enabled", "is__stop_on_slope_enabled");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "_constant_speed"), "set__constant_speed_enabled", "is__constant_speed_enabled");
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "_block_on_wall"), "set__block_on_wall_enabled", "is__block_on_wall_enabled");
	ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "_max_angle", PROPERTY_HINT_RANGE, "0,180,0.1,radians"), "set__max_angle", "get__max_angle");
	ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "_snap_length", PROPERTY_HINT_RANGE, "0,32,0.1,or_greater,suffix:px"), "set__snap_length", "get__snap_length");
	ADD_GROUP("Moving Platform", "platform_");
	ADD_PROPERTY(PropertyInfo(Variant::INT, "platform_on_leave", PROPERTY_HINT_ENUM, "Add Velocity,Add Upward Velocity,Do Nothing", PROPERTY_USAGE_DEFAULT), "set_platform_on_leave", "get_platform_on_leave");
	ADD_PROPERTY(PropertyInfo(Variant::INT, "platform__layers", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_platform__layers", "get_platform__layers");
	ADD_PROPERTY(PropertyInfo(Variant::INT, "platform_wall_layers", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_platform_wall_layers", "get_platform_wall_layers");
	ADD_GROUP("Collision", "");
	ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001,suffix:px"), "set_safe_margin", "get_safe_margin");
	BIND_ENUM_CONSTANT(MOTION_MODE_GROUNDED);
	BIND_ENUM_CONSTANT(MOTION_MODE_FLOATING);
	BIND_ENUM_CONSTANT(PLATFORM_ON_LEAVE_ADD_VELOCITY);
	BIND_ENUM_CONSTANT(PLATFORM_ON_LEAVE_ADD_UPWARD_VELOCITY);
	BIND_ENUM_CONSTANT(PLATFORM_ON_LEAVE_DO_NOTHING);
}
void CharacterBody2D::_validate_property(PropertyInfo &p_property) const {
	if (motion_mode == MOTION_MODE_FLOATING) {
		if (p_property.name.begins_with("_") || p_property.name == "up_direction" || p_property.name == "slide_on_") {
			p_property.usage = PROPERTY_USAGE_NO_EDITOR;
		}
	} else {
		if (p_property.name == "wall_min_slide_angle") {
			p_property.usage = PROPERTY_USAGE_NO_EDITOR;
		}
	}
}
CharacterBody2D::CharacterBody2D() :