I’ve read the supposedly definitive bios of both men. Bruce at one time had literally lost all his soldiers, was literally alone and chased through Scotland, while his wife and daughter were held in cages dangling outside an English castle. I can’t find from these what, if any, role Bruce had in betraying Wallace, but his story after that is wildly inspirational.
IIRC, the saying “If at first you don’t succeed, try, try again” comes from Bruce’s experience on the lam where he is alone in a cellar of sorts watching a spider try to reach something.
I wouldn’t take anything from Robert the Bruce, and don’t assume his role in the movie is an accurate portrayal. I couldn’t imagine the lot of peasants in either country, and imagine the socialism they’ve embraced over time was designed to protect the nobility from the wrath of a lower class with nothing to live for.