I've done that job on my Pearson 28-2. My original bolts were in good shape so I have nothing for you there, but it sounds like others have given you sources or possibilities for long, thin bolts.
I drilled out and potted the deck holes with thickened epoxy, then redrilled to isolate the core. I put that job off for months because I was worried about realigning the holes top to bottom--the angle has to be right to get the bolt through the handrail on both sides. Finally just did it, with a jig on the hand drill to assist in making the holes perpendicular to the deck. Had to widen some of my holes a bit but got it back together, and swore I'd never take the handrails off again.
2000 Beneteau 331
Northern Chesapeake Bay
Ambition is a poor excuse for not having enough sense to be lazy ~ Steven Wright