Gerard Pique won the 43rd-minute spot-kick that proved the difference between the sides but, after back-to-back draws against Valencia and Athletic Bilbao in the top flight, Ernesto Valverde's men were again short of their fluent best.
Those previous results and Atletico Madrid's win over third-bottom Rayo Vallecano earlier in the day meant Barca went into the game with its now-restored lead at the top trimmed to four points.
Former Blaugrana goalkeeper Jordi Masip impressed in goal for Valladolid, not least after substitute Philippe Coutinho won a second penalty and he plunged to his left to deny Messi.
Referee Juan Martinez Munuera rejected earlier penalty claims from Kevin-Prince Boateng on his first LaLiga start but was persuaded by Pique's slightly theatrical fall under Michel's clumsy challenge.
Masip guessed correctly to his left but was beaten for power and accuracy by Messi, before Pique made himself useful in his own box, getting a vital touch with Enes Unal poised to convert Nacho's cross.
Sergi Guardiola dragged a shot wide as Valladolid continued to acquit themselves well in the second half, although it was indebted to a stunning reaction save from Masip as he denied Messi on the half-volley.
The visiting keeper scrambled from his line effectively to snuff out danger after Boateng sprung a flimsy offside trap in the 55th minute.
Luis Suarez replaced the ex-AC Milan attacker with an hour played and he was soon thwarted by Masip in a one-on-one.
Messi's frustrations approached boiling point as he was booked for protests after a robust challenge from Anuar Mohamed.
He would prove the match-winner, even if Masip did his mood no favours five minutes from time, calmly pouching his headed follow-up from the penalty save.
This was certainly not the performance Valverde will have wanted in the week he signed a surprise contract renewal at Camp Nou. Victory guaranteed Barcelona will return to European action next week holding at least a six-point advantage at LaLiga's summit, with Real Madrid in action against Girona on Monday (NZDT).