Useing loose corn kernals or peanut butter can attract mice and they may not trip the trap or escape easily even if they do trip it . If your sure a racoon has been escaping is it springing the trap but escaping ?
Once a coon has become trap shy , I've had to leave the trap with the trip lever NOT set and door propped open so it CANNOT close . I'll start leaving just a little bait about a foot or two out in front of the trap for a few nights untill its being eaten and then a little just inside of the trap so the coon can get to it without going all the way in . When that disappears I'll finally put most of the bait all the way to the back of the trap with just a couple of bites out a little farther .
I think one big mistake many people make is buying too small of a trap . Once that old coon has had a trap door drop on its rear and backed out its hard to catch it again . The one that works best for me is 36" long , 11" wide , and 12" tall , and just one door . The trip pan is close to the rear but room enough to lay an ear of sweet corn or a fish behind it ; and you can use wire or fish line to tie it to the bait pan or to the trap bottom just behind the trip pan as somebody already pointed out . You can also use a bale of straw on each side holding another bale over the trap [ kinda like two walls and a roof ] . Around here coon are used to living in and hunting mice in between bales in haymows and go right in .
Good luck .