How do deal with low self-confidence after a failed research rotation?
As suggested in a comment, ask your present PI to sketch out explicitly the goals for this rotation.  Take the initiative by writing a first draft, but ask the PI to help you refine your list.

Send the PI regular progress reports.

Try to find a support group.

It's fine to let a PI know of your diagnosis, but unless this person has personally demonstrated his or her trustworthiness, over a significant period of time, I suggest you draw some clear boundaries in your own mind, between what personal information you will share with a PI, vs. what personal information you will share with a support group or a therapist.

Read what I wrote about figuring out which educational accommodations would be helpful for you in this other answer.

Consider having a few sessions of EMDR about the specific trauma of the recent failed rotation.  Here is a link to get you started reading about EMDR: https://www.emdr.com/what-is-emdr/