Your credit score or a bankruptcy does not affect your ability to take the exam, pass it and obtain a license to sell insurance. What might keep you from getting licensed is that you are to young or if you have a felony conviction on your record.
Although there is nothing stopping you from obtaining your license, candidates that want to sell health or life insurance are typically disqualified from employment once the -U4 is filed. A U-4 is a form that is part of your paperwork in obtaining your license once you have passed the actual licensing test. It is kept on file by the Financial Industry Regulatory Authority, FINRA, who is responsible for regulatory oversight of securities licensees. Completing this form includes a comprehensive residential and employment history for the past 10 years as well as a criminal background check and credit report assessment. Unfortunately, candidates that have serious credit issues, such as a bankruptcy or a criminal history besides minor traffic offenses are generally disqualified at this point.
Bad credit unfortunately does keep you from a career as a broker.