I found that after each time Max Payne is killed and when he is re-spawned, the amount of painkillers gets added by one which make the game a little easier. Is it a bug or is it that way that the game is designed.
This is not a bug, it is designed in the game depending on which difficulty you are playing on.
Easy and Medium settings feature dynamic difficulty which provides access to extra painkillers to help you pass particular parts of the game if you've died repeatedly. On Easy and Medium settings, when you die at a checkpoint, you restart the checkpoint with at least one full magazine of ammo in each gun (except grenade launchers) and the number of painkillers that you started with. For every three times you die at a checkpoint, you get one extra painkiller. So if you started a checkpoint with 2 painkillers, and died 3 times, on each subsequent retry of that checkpoint, you'd start with 3 painkillers. If you died 3 more times (6 total), you'd start with 4 painkillers on each subsequent restart. On Easy and Medium, this can continue until you are respawning with a full 9 painkillers.