Twice-baked may not be for roasting and darkening. The first baking cause it to rise and fixes the taste. The second baking dries it out for longer term storage. Just like zwieback cookies for teething babies.
Yes, this is the current mainstream theory, but doesn't quite match the Sumerian stored food lists:
http://sidurisadvice.com/Damerow.html
Damerow's research is actually one of the major pieces of evidence in support of the burnt bappir hypothesis...