How do I repair this stair rail hole and screw back in?
These work best if the screws are driven into a wall stud vs. a hollow-wall anchor.  It's not clear what you have going on here, but if it's an anchor, or just a screw driven into drywall, then you should relocate to a spot where you can hit the stud.
Patch the hole with some spackle and if needed, you might need some backer as this looks to be a fairly large hole.