You need to account for free phosphates (Pi) that derive from ATP and are released in phosphatase reactions. The regeneration of 3 ribulose-1,5-2P has the overall reaction
5 glyceraldehyde-3P + 3 ATP $\rightarrow$ 3 ribulose-1,5-2P + 3 ADP + 2 Pi
So in total eight phosphates (here counting ATP as 1) are redistributed, 6 of which end up in ribulose-1,5-2P, and two are released as free phosphates. (These Pi are then recaptured during ATP synthesis in the light-dependent reactions.)
The above is a summary reaction of course; the complete scheme involves 10 enzymatic reactions that rearrange carbons in various ways to form 5-carbon sugars from 3-carbon ones (which takes a bit of juggling of atoms). Release of free Pi occurs in the fructose biphosphatase and seduheptulose biphosphatase steps.
A detailed account can be found in any major biochemistry textbook, like Stryer's Biochemistry. Online resources like MetaCyc can also be helpful.