This passage isn’t as much about forgiveness as correction. You are supposed to forgive no matter what (77 times). But this is if someone is doing wrong and needs to be corrected. If no matter what they will not stop their bad behavior then depending on how serious it is they cannot be allowed to keep being a part of the community.