A 24VAC sinisoid peaks at 34V, which is what your cap will charge to.Its rated for 25v and I'm not sure how long it was on the shelf. My transformer is 120VAC to 24VAC so was I wrong to assume the capacitor would never see voltages higher than 24VDC? New to electronics
You want some pretty good headroom on your working voltage rating, so I would be real hesitant to use anything less than a 50V rated cap and would much prefer 63V or 80V. Even at Digi-Key prices, you'd be looking at $4 for an 80V cap versus $2 for a 25V cap. Just the aggravation you've already gone through is worth that.