The second generation Apple Pencil is not compatible with the just-announced new iPad Pro M4 models.
The front camera and FaceID sensor array have been relocated from the short-edge to the long-edge of the iPad - such that the camera and sensor array are now positioned top-centre of the screen when the iPad is positioned in Landscape orientation. As such, the camera/sensor array now occupy the internal cavity previously used for the second generation Pencil's inductive pairing/charging system.
To accommodate this change, the charging system for the Apple Pencil has been completely redesigned - moving the associated electronics to different cavity locations along the top edge of the iPad chassis. The new Apple Pencil Pro has been specifically designed to accommodate the new physical architecture.
As such, the second generation Pencil is incompatible with the new iPad's Pro. Similarly, the new Apple Pencil Pro is also incompatible with earlier models of iPad Pro.
Here is Apple’s definitive compatibility list for Apple Pencil and iPad:
Apple Pencil compatibility - Apple Support