Two pointsets in $\mathrm{PG}(2,q^n)$ and the associated codes