Currently at work, so can’t test anything.
But consider testing the following 2 natives;
SetCurrentPedVehicleWeapon
SetCurrentPedWeapon
The only thing I can think of off the top of my head, is that GiveWeaponToPed is not forcing it in hand while in a vehicle, since SetCurrentPedWeapon has the same boolean parameter and SetCurrentPedVehicleWeapon doesn’t. So it’s like you can’t force it in hand while in a vehicle, by default.
I wonder though, if it’s also because when you give a weapon to a ped, usually it only equips it right away if it is more powerful than the rest of their weapons. GTA likes to prioritise, so if you have a powerful weapon like an SMG, then give a pistol, it won’t swap. But if you have a pistol and give an SMG or something, it will. But tinker with those 2 natives, in my opinion. See what’s possible.