It turns out the issue was due to the @Data annotation, which was causing an infinite loop in the background, likely due to the toString, hashCode, and equals methods —or possibly just the toString method alone; I'm not entirely sure.
To resolve the issue, I removed the @Data annotation and implemented the getter and setter methods manually, which fixed the problem.
in addition, from my research, it appears that using a bulk remove method is more efficient in many-to-many relationships from a performance standpoint. Normally, Hibernate sends multiple queries for the deletion process, which can lead to performance issues. Therefore, it’s recommended to manually write a single delete query to improve performance in these cases.