I assume you mean you damaged the interior panel only? If you use expanding foam, you need the 'minimal expanding' type, the max. type could cause a bulge in either the interior or exterior panel. Also, if you are trying to reuse the busted piece and keep it flush with the rest of the wall, you will probably need to drill a small hole in the center and use a long screw as a handle to be able to rotate the piece and hold it flush while the foam expands.
A more common technique is to take a small piece of wood slightly wider than the opening, maybe 1/2 inch on each side. Put a screw in the center of the wood, use wood glue on each side where it overlaps the hole, slip it into the opening and hold it in place til the glue sets. Then remove the screw and glue the busted piece onto the wood to make it flush. Use normal wood glue, or Gorilla Glue is OK, it slightly expands and sets quicker than wood glue, but before it sets, you need to clean off any excess that would keep the busted piece from fitting flush.
Texas Baptist Men-Retiree Builders member since '01
13 Silverado 3500HD D/A, 2wd CCSB srw, custom RKI bed
11 Cruiser CF32MK