Raid never finishes if the player is set to peaceful mode when subjected to raids.
MC-139993 When players in peaceful mode walk into the village, can still trigger a raid
MC-140134 Peaceful Mode Softlocks Raids
MC-140140 Pillager raid boss bar stays in Peaceful difficulty
MC-139979 Raid never finishes if raid mobs aren't killed by player
MC-140113 Raid bar will not decrease when raid mobs walked into the nether portal, end portal or end gateway