If your wall is not completely straight (many walls are not, this is reasonably common in buildings), you have a couple options. The important thing to remember is that the bracket cannot bend significantly or it won't engage properly.
You can learn more about bending the bracket, why it's a bad move, and how to get around it here.
You may also find this article on whether you can scribe the shelf of use.
The curved / bowed wall problem is not new and there are definitely ways around it. This problem can manifest in two ways - Either the wall is concave or it is convex. In most standard cases we see, they tend to be concave.
In either case, if you end up with a gap in some spots between the wall and the shelf that is less or equal than ¼ of an inch once the shelf is installed, you can put a bead of clear silicone between the shelf and wall. Take a spray bottle full of water, moisten the bead, wall and shelf a little bit, and then wipe off the excess with a paper towel.
This is an old trick from kitchen countertop installers. Once dried, the clear silicone will interact with light in such a way (through the wall and shelf) that you will not see the gap anymore. Reframing the wall is not necessary, unless the gaps are more than ¼ of an inch or more.
Also worth noting is that the bracket is designed in such a way that if the male bracket (the one attached to the wall) is connected into several studs, some screws that hold the male bracket to the wall on different studs can afford not to be drilled in all the way. Applied within reason, this will not jeopardize the integrity or strength of the bracket.
Below are two sketches that illustrate the above points:
You can either shim the gap between the bracket and wall, or leave it as is. If you do choose to leave the gap, be sure not to overtighten the screw when installing the male component to the wall, or you will bend the bracket inwards towards the wall, and the female bracket component will not be able to engage with the male.
Now let's say you're worried about the look of a gap between the wall and shelf - that's a fair concern. But don't worry, there's a fix for that too! This is an old trick borrowed from kitchen countertop installers: Once dried, clear silicone will interact with light in a room/space in such a way that it shines through the wall and shelf and disguises the gap from being seen. No need to reframe the wall just to get the look you want (unless you are VERY dedicated and the gaps are ¼ of an inch or more.