I worry this could be a hardware failure, do you still have warranty?
If your friends SIM didn't work either, it looks like the sim tray electronics are faulty. If that is the case, you yourself can't do anything to repair this, so if you still have warranty, I would flash stock OS again, try if the SIM is still not working and if so, open a warranty case with Google.