There are twenty insects. "Insects" is plural.
but
There is a total... "Total" is singular.

The prepositional phrase "of twenty insects" doesn't determine the verb.

So "There is a total of twenty insects," but it may sound awkward to you. (It doesn't to me - "There are a total" sounds awkward to me - but I tend to be a prescriptivist.) The way to handle awkwardness is to rephrase the sentence. There are many insects, in fact a total of twenty. That's less awkward, but more wordy. Sometimes that's the price of clarity.