I am sorry you are having this problem. I have had the same thing happen but not about being in a wedding.
What role are you fulfilling in the wedding? A grooms man. Would there be a chance that you could talk to your friend and if you cannot stand in front at the wedding, you and the usher could just change places?
No one is going to think less of you, and if they think anything.........tough, they own the problem. You need to just take care of you.
Therapy would be helpful. You wrote "I don't know what to do anymore". Boy we have all said that a bazillion times. It seems hopeless and we feel the need to fix it right now. Be good to yourself and just be in the moment. Have your plan set or if you have to sit down, have a explanation. Your felt lightheaded, no breakfast, to hot in suit............make it just a short explanation.
Keep posting as you will receive lots of support.
Now when You go to the wedding, bring me back a piece of cake....I love wedding cake.
Bless you my friend.