The book I am using, explains に is used here to indicate the passive form. I looked up a video explaining it by Misa from Japanese Ammo. She explains that one of the reasons to use passive form, is to express feeling upset, angry or embarrassed. Apparently Verb te-form + しまいました can be used to express regret or embarrassment. Now, Misa does not explain in that lesson that the passive could also be formed with Verb te-form + しまいました, the website that explains Verb te-form + しまいました does not include passive examples. Can you build the passive with Verb te-form + しまいました instead of the passive form of the verb?
The passiveness here has nothing to do with てしまう. Your sentence uses the verb 捕まる which means "to be caught". The passive is inherent in the verb choice. Compare this with the verb 捕まえる which means "to catch". Japanese has a lot of verb pairs like this.
The てしまう ending merely adds a sense of regret as you correctly stated.