How do I reconnect cake pieces that stuck to pan?
In my experience using frosting to join broken cake will just draw attention to the fact something went wrong. If the loose part is on the bottom you can rely on gravity to keep it together, and when you slice it up if it comes apart you just put it on the plate and say nothing. 

If gravity is not going to do the job then frosting will work fine, but be a bit obvious. Less obtrusive is food glue, which is simply watered down white fondant icing/sugar paste.