Trivial and inverted Dirac bands and the emergence of quantum spin Hall states in graphene on transition-metal dichalcogenides