Place a straight board across the loose layout marks. Each bracket can be upright while its top lands above or below the other one.
Illustration: both brackets are upright, but their shelf support edges don’t align.
Choose one horizontal reference and mark both intended top edges from it. Compare the actual shelf support surfaces, especially if the brackets have different shapes.
Hold a straightedge across both marks and check it before making holes. For installation, match hardware and supports to the wall and shelf load.