  We study a non-universal $U(1)_{X}$ extension of the Standard Model with an
extended scalar sector of two doublets and one singlet plus three additional
exotic quarks and two exotic charged leptons on the fermionic sector. In order
to obtain the observed fermion mass hierarchy, an additional $\mathbb{Z}_{2}$
discrete symmetry is imposed, where the heaviest fermions acquire their masses
from three different scales determined by two Higgs doublets and one singlet,
whereas the lightest fermions obtain their masses from effective operators up
to dimension seven. From chiral anomalies cancellation, the model also includes
heavy right-handed neutrinos which get massive via an inverse see-saw
mechanism, reproducing the observed mass differences for the active neutrinos.
We analyze phenomenological consequences of the model in view of the so-called
flavour anomalies, namely the latest measurement made by Fermilab of the
anomalous magnetic moment of the muon $g-2$, and additionally, the fit to
semi-leptonic $B$ meson decays made by different flavour groups, dominated
mainly by the LHCb 2020 data. We obtain that the model can explain the former
at the $1\sigma$ level by means of contributions coming from charged $W^{+}$
bosons interacting with exotic Majorana neutrinos at one-loop level, with the
$Z'$ boson contribution itself coming from the $U(1)_X$ symmetry being
negligible. However, we find that the model is able to accommodate the $b\to
s\ell^{+}\ell^{-}$ transitions associated to the $B$ meson anomalies only at
the $2\sigma$ level via tree-level $Z'$ boson exchange, while simultaneously
respecting various constraints from the recent $R_{K^{(*)}}$ measurements made
by the LHCb, neutrino trident production and $B-\bar B$ oscillations.
