I do not see that you are doing anything wrong.
However I made some changes that might improve things —
lpf1 = designfilt('lowpassfir','FilterOrder',46,'CutoffFrequency',5000,'PassbandRipple',1,'DesignMethod','cls','ZeroPhase',true,'SampleRate',1e6);
lpf2 = designfilt('lowpassiir','FilterOrder',3,'PassbandFrequency',5000,'PassbandRipple',1,'StopbandAttenuation',55,'DesignMethod','ellip','SampleRate',1e6);
freqz(lpf2.Coefficients, 2^16, 1E6)
These are two different filters with different characteristics.
The phase delay/distortion will likely disappear with fitlfilt rather than filter to filter the signal. Tha is true for FIR and IIR filters in MATLAB.
In general, FIR filters require a much higher order (and so are llss computationally efficient) than IIR filters to get the same response. Here, I increased the IIR filter order from 6 to 46.