Does Bobby like banana or any other form of soft food? Medicine can often be squeezed onto or inside a favourite food and eaten without the bird realising. Failing that the only other way if your bird is not used to eating from a spoon is to gently towel him and quickly administer the medicine.
I wonder with the pellets if he isn't drinking enough to moisten them to digest through the crop. After having been on a seed diet for so long he may not be used to the increased drinking which is required from a bird on pellets. Crop infections are caused by food staying in the crop too long and this could be a plausable explaination.
All my birds are fed a very good quality seed with plenty of fresh fruit, veg, pulses, rice, pasta etc.