IIRC Black flags were supposed to mean the pirates were more civil while red flags were supposed to mean the pirates were more barbaric.
It's not bad history, just slightly lazy history.
Richard Hawkins, captured by Francis Spriggs, wrote
"...Jolly Roger (for so they call their black ensign, in the middle of which is a large white skeleton with a dart in one hand striking a bleeding heart, and in the other an hourglass). When they fight under the Jolly Roger, they give quarter, which they do not when they fight under the red or bloody flag."
Which is the origin of the idea cited by OP, although the red flag was used by privateers to signal 'no quarter' from at least the 16th century.
A second source (off the top of my head, maybe George Roberts) says exactly the opposite.
The Dutch Commodore Roggewein reported when he was attacked by pirates that they switched between red and black flags with no apparent meaning attached to either.
However, it's also important to note that not all pirate flags were red or black. White flags were reported on occasion, and privateer George Shelvocke was convinced in 1719 that the most common colour for pirate flags was yellow with black devices.
"ordered the Emperor's colours to be hoisted, which, without any reflection look the most thief-like of any worn by honest men; those of his Imperial Majesty are a black double headed eagle upon a yellow field, and those of the pirates a yellow field and black human skeleton; which at a small distance are not easily distinguished."