The market price would be floored at $21 as it costs the producer $18 to produce and a $3 tax. The prior margin was $1 so realistically the producer would eat some of the increase and charge $21.50
For the person who values the good only at $20, no transaction would take place. If eventually the producer cost went down to something like $16, maybe the price would come down to $20 or below but then there's the marginal consumer that values it at $19.
Price distortions almost always result in a dead weight loss. Only in perfectly inelastic products does it not exist