OP, I was struck by the fact that you felt too uncomfortable to tell your second (less close) friend that you can't drink red wine.
I think you could let them know - at an opportune moment, just mention that you 'have discovered' that red wine is a migraine trigger. You don't need to say when you discovered this. I think it would be a good way of letting your friend know for future reference, while at the same time avoiding the issue of the bottle they gave you.
Regarding the re-gifting issue, I don't see this as a problem!