That's a pretty odd one. I have never seen anybody install rail brackets with anything but screws, straight into a stud, or similar structure. That's the specific reason that most brackets are narrow, and have three holes for long screws. I assume that the rail is a bit short for the job, and doesn't reach the end of that wall? The reason I'm guessing that is that there are frequently two studs nailed together, at the end of a wall like that, giving lots of structure to screw into. Another option is to grab a stud finder and move down slope until you find the closest stud, which shouldn't be far away. Bottom line is that, if somebody is grabbing a rail to prevent a fall, they are placed the mounting flange of the bracket under tremendous load, and anchoring them to the drywall is far from optimal.