Assuming that a person has just cause to have to leave Mass early, no, it is not necessarily a sin. For example, although I wait until after the priest has processed out, I usually leave Mass before the concluding hymn ends because the applause at the end of the Mass highly annoys me. There could also be other just reasons for leaving Mass early, such as the care of young children or of a disabled person for which it may be made easier by not having to negotiate crowds.
That said, unless there is just reason, one should not leave Mass until it ends. Leaving early without just cause is reminiscent of Judas Iscariot, who left the Last Supper early in order to betray Christ. However, just as the apostles charitably presumed at the time of Judas’s leaving that he had good reason to do so, so we should charitably presume that early departers from Mass also have good reasons for doing so (cf. John 13:21-30).