I only know about the Lee Enfield and later British rifles, a heavy weapon will absorb recoil better so helping to prevent the round being ‘snatched’ by movement of the rifle before the round has left the barrel.
Adding a bayonet shifts the already heavy rifles centre of balance further forward (fulcrum/pivot action) and caused a tendency for the barrel to drop, better precision is done by supporting the length of the barrel fully - we used to adopt lots of firing positions to hold the weapon firmly and allow it to naturally point to the target, for longer ranges though you really need a forward support which is why nearly all sniper rifles now have bipods to support the end - a bayonet would have just made it harder to hold and I doubt the added weight would have made much difference for recoil purposes