This is akin to issue MC-259414, but pertains to view bobbing instead of damage tilt. When view bobbing is enabled, your camera moves, yet it doesn't affect your aiming direction, allowing you to target a block that your crosshair isn't directly positioned over. This behavior mirrors what's observed in MC-157877. To replicate, execute the following commands:
/fill ~ ~-1 ~ ~20 ~-1 ~ stone
/execute align xyz run tp @s ~ ~ ~ -90 ~
Then traverse the bridge, and you'll notice how you're aiming at blocks even when your crosshair isn't directly over them.
Linked issues
is duplicated by 2
Attachments
Comments 5
Indeed, that's precisely what I'm reporting, and what you describe aligns with the behavior observed with damage tilt.
i'd like to point out that if this is "fixed" then that would lead to a pretty substantial difference in what your cursor is pointed at when you have View Bobbing on/off and are moving
that seems like a really bad side effect of this issue being fixed

It'd be impossible to make view bobbing affect cursor aiming without breaking the behavior when not using view bobbing. This would also be a terrible change for those who want to use view bobbing but do not want their attacks to miss because of it.
The difference between this and MC-259414 is that MC-259414 concerns an issue that could be circumvented by simply reworking the mechanics of the forward/back damage tilts to not physically move the camera (ie: actually making them tilts like the sideways ones). It's not possible to make this fix for view bobbing.

Thank you for your report!
After consideration, the issue is being closed as Working as Intended.
Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.
Full Version History – Snapshot Version History – The official Minecraft feedback site
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
If this is not also considered a duplicate of MC-159952, I can confirm. May relate to other view bobbing issues like MC-267368 MC-176454 MC-159952 and MC-159952 (as pointed out in the issue).
Worth mentioning that the swaying motion of view bobbing is purely a visual effect of the camera, as it does not affect the 'Facing' direction of the player seen in F3. Technically, the player is still looking at the block despite the reticle not entirely reflecting that.