How do I convert a service panel to a junction box?
Assuming it's not prohibited by your local codes and the existing panel is not violating any current codes like overfill, working space clearance, there's nothing code-wise that says "No this is prohibited".

However, a better solution if possible, since you have to run new wires anyway, is to install a 12x12 or larger junction box in the attic and crawl space and be done with it.

Now it would be wise to consult you Building and Planning Department first as most of the time the Power Co. will not reinstate power unless the work is permitted.  Also, not sure about your local jurisdiction but around here they make us install hard-wired smoke alarms in every bedroom and in every hall near a bedroom if a panel is upgraded.