I had been talking to company A about doing an internship there. I had several concerns regarding the assignment but I needed it fast, so I applied anyway and got accepted. I agreed to start the internship but did not yet sign a contract. After a few weeks, it became clear that they refused to sign the university's contract, which I had explained to them before is a prerequisite for starting my internship. After e-mailing back and forth, We still did not manage to find a solution.
A few days later I received an offer from company B. I went for an interview and got informally accepted. Company B's assignment was better fitting and they agreed to sign the contract without any problems. At the beginning of the next week, I managed to settle the contract issues with company A but still decided on company B. However, I had already agreed to start my internship at company A.
Since I had not yet gotten formal confirmation from company B and did not want to risk ending up without an internship, I decided to only cancel company A when I received confirmation from company B. I only got the confirmation from company B on Friday and I was supposed to start at company A the next Monday. That Friday, I e-mailed company A, cancelling my internship. I received a heated reply for cancelling last-minute and they even e-mailed my university supervisor. Can I expect bridges to be burnt or do I still have a chance of ever applying at company A? How could I have handled this situation better?