This can work. But can also not work. It is more of an art than anything. I'd do what SPDguns suggested. A dowel that just fits the hole is the easiest fix. I have done this many, many, times for repairing stripped screw holes in wood and just used wood glue. Never had one fail me yet. Even if the stud is going back in the same place (or close to it) it would hold just fine.