If they kept attacking you and kept killing your Sam then the most likely reason is that his amity is too low now because he kept dying so no it's not a bug. However you can get him back and he will still be level 24 but his amity will still be low so you will need to get it back up high if you don't want him to run away anymore during the battles. I think you can get him back if you go to the place where Sam originally joined your team (forgot the place sorry) for the first time.
Good luck! ~