What size beam do I need to span 20' on a 25' roof?
What Nate said in his answer is true, but need to go a bit further on this question.  There are several charts available that specify beam sizes based on span, spacing and types of materials used. A beam 20 foot long would be difficult to create with dimensional lumber, but not impossible.  You will be more likely to find that a LAM or steel beam will be required. Since you already have a negative input from the code enforcement folks, you may have to consult a reputable builder or structural engineer for guidance. I would not take any specific advice from a non professional in your case.  Redoing this job will not be cheap, so do it right the second time. If the code officer will not tell you what they want to see, you will most likely be well served to have a spec certified by an engineer before proceeding.