Code B is a valid distribution code for a designated Roth account. May I assume that the account you took the distribution from was a Roth account?
Was this a Roth account that was created at least 5 years ago? Are you at least 59 1/2?
What was the IRS reject code?