One of my rescue dogs I gave to a relative. This dog has tape worms from eating bunnies and racoons. They may have to worm him twice ... as he seems to still not be gaining weight. Maybe your dog needs wormed twice by your vet. I am not sure how easy it is to get rid of tape worms?
Maybe someone else will chime in with an answer that would benefit the both of us.