The effect of carrier density gradients on magnetotransport data measured in Hall bar geometry