When you say the gun jammed, could you be referring to the bolt being locked by the bolt release? If it only happened after you inserted an empty magazine, that sounds like the obvious answer. I think we need a better description of "jammed."
Also, when you say both halves were stuck together, do you mean that you couldn't remove the takedown pin? If yes, then that's because the bolt release, whether intentionally or not, is acting as a takedown pin retainer in the presence of an empty magazine. Again, I think we need a better description of "stuck together."
Finally, you say you finally got it apart. How did that happen?