Unless you get a custom made tamper (e.g. Reg Barber), you will always have some slack. You would have to measure your filter basket accurately to 2 decimal places to have a tamper with a perfect fit.
Having some "slop" is to be expected with the equipment you have (Gee, that didn't sound quite right!
).
Let's try again...with an inexpensive machine, the fit you have with the 51mm tamper is probably the best you can possibly have (assuming the tamper is, in fact, 51mm).
I would not suggest spending whatever a Reg Barber custom made tamper ( about $75) with the equipment you now have. While not inevitable, the probability is that you will upgrade sometime in the future. The likelihood of the tamper fitting you new basket is poor. More importantly, when/if you upgrade, you will likely have a 58mm basket, which is what comes with higher level machines.
So...my guess is that the fit, though not perfect, is what you can expect with any 51mm tamper (again assuming the measurement is roughly correct) with the equipment you have now. Don't let a
little slop bother you, it is to be expected. However, I am assuming that the fit with the 51mm is better than the 50mm.