Barca, who were thrashed 4-1 by Paris Saint-Germain in the Champions League earlier in the week, were hoping to bounce back with an eighth straight league win.
But after Messi opened the scoring with a first-half spot-kick, Alex Fernandez despatched one of his own against the run of play to once again spoil the party for Ronald Koeman's men.
Messi, who equalled Xavi's previous record in last week's thumping 5-1 victory against Alaves, was one of several Barca players thwarted by Cadiz goalkeeper Jeremias Ledesma.
Elsewhere in LaLiga, leaders Atletico Madrid slipped to their first home league defeat since December 2019 on Saturday when losing 2-0 to Levante.
City rivals Real Madrid took full advantage by beating Real Valladolid to climb to within three points of their city rivals, but Barca were left frustrated.
Ronald Koeman's side made all the early running as Antoine Griezmann blazed over from inside the penalty area and Messi twice tested Ledesma.
But Barca made the breakthrough via the penalty spot in the 32nd minute. Isaac Carcelen brought down Pedri and Messi coolly converted his first goal against Cadiz, left-footed into the bottom corner.
Messi became the second player to score 60 penalties in LaLiga after Crisitano Ronaldo, who netted 61 for Real Madrid.
Cadiz then spurned a golden chance to equalise on the counter-attack when forward Ruben Sobrino fired off target after running on to a flick-on.
Barca pair Frenkie De Jong and Pedri both had efforts ruled out for offside before the break.
Cadiz remained a threat, but continued to be outplayed after the restart, with Griezmann denied by Ledesma's superb reaction save.
Ousmane Dembele twice threatened after mazy runs as Barca pressed for the all-important second goal and Messi flashed another shot wide.
Cadiz, who won at Real Madrid in LaLiga in October and beat Barca in December, repelled all that Barca could throw at them and then in the 88th minute were handed a chance to snatch a point.
Clement Lenglet was adjudged to have brought down Sobrino in the area and Fernandez sent Marc-Andre Ter Stegen the wrong way when converting from the spot.
Barca went close to a last-minute winner, but Ledesma pulled off another superb save to deny Gerard Pique.
Lionel Messi was denied victory on his record-breaking 506th LaLiga appearance for Barcelona as Cadiz struck a late penalty to clinch a 1-1 draw at Camp Nou.