I think this is really common. Things that have helped me.
1. Record your entire practise session, rather than placing emphasis on that one moment where you want to record yourself. Make it part of your routine.
2. Get lost in the music and relax. Don’t rush through each bar as if it’s a checkpoint to be completed.
3. Play songs which you can improvise to build confidence ie. A jazz backing track in A minor. You can’t make a mistake if you’re making it up 🙂
4. If none of this works pour a large glass of whisky 😂