I ordered from Amazon 12 boxes of gluten free cookie mix under a certain Hashgacha. I received the cookie mix, but now apparently it is dairy under a different Hashgacha. Amazon credited my account but doesn’t want me to return these items. Can I give it to a Jewish food pantry?

If it is indeed not Cholov Yisroel, you should not give it to a Jewish food pantry.

See here at length:

Can I regift a present of food that has a Hashgocha which I wouldn’t rely on? How about other products that are not Cholov Yisroel / Pas Yisroel, etc?