Staley cut the Utah lead to three with a two-point conversion run.
A 2-point conversion run failed, leaving Miami with a 5-point deficit to make up and 6 minutes 56 seconds left.
Miami still led, 14-12, after Houston's failed 2-point conversion run.
He also scored on a two-point conversion run.
Bernard barely pushed into the end zone on the gutsy two-point conversion run, giving the 24th-ranked Beavers a 39-38 victory, having been down by 14 points earlier in the game.
A 2-point conversion run was stuffed.
With 2 minutes 41 seconds remaining, Palmer hit Kevin Lee for a 26-yard score, but Palmer's 2-point conversion run failed.
Then Sammy Morris scored a 2-point conversion run, cutting their deficit to 14-11.
The Titans kept their rally going in the fourth quarter with Collins getting a 10-yard touchdown run, followed by running back Chris Johnson's 2-point conversion run.
Joe Charlamagne, whose father died on Thursday, had the winning 2-point conversion run.