This is kind of exactly the right answer, isn't it?
If you really want epoxy you can force it to hold mechanically, if it won't bond otherwise, by creating surface texture by sanding, etching or drilling small holes at angles into a piece. The point is to have the epoxy harden around and in surface features that lock it in (much the way screws hold) so it stays put.
This would be most useful when you want to sand/smooth a surface and paint it, or don't have room for screws.
I know, but the broken off peg was so small I couldn't clamp or put weight on it. Then the superglue also had issues with curing, it broke off immediately, then some residual superglue immediately bonded the peg inside the peghole. So I had to resort to drastic measures: converting the peghole into a screwhole.