I copied in and got the same results - kicked it about till I got it to work - I think.
removed $coreCfgInnerPiece
removed $output.innerxml
added $out = @() but I think that's useless here
Try that and see if any work for you. It did import in the IP I gave it.