why is the coffee like sludge in the portafilter?
If you mean that it’s not a solid puck that you can knock out whole into the bin, that may not be just down to the machine. You might find that increasing the dose/amount of coffee results in a more solid puck, but this might choke the machine (equally you might like the results of increasing the dose). What you won’t be able to do is increase the dose and at the same time coarsen the grind to compensate and thus prevent choking, because you are using pre-ground.
I’ve seen some people working in ‘coffee shops’ using decent commercial equipment (e.g. in Marks and Spencer) use a brush to wipe out the sludge betwen shots, which I would take as a good indicator that they have not been properly trained to use the equipment and the coffee is probably awful.
In your case providing the taste of your coffee is good, it doesn’t matter.
Even the 20-25 second criteria is just an indicator of whether the shot is likely to be a bad one. It doesn’t guarantee that a shot within that time is definitely a good one, but if you get a 5-10 second gusher and taste it, you can be pretty confident it will be bad (but I suggest you taste it to find that out for yourself as part of your learning curve). Shots over 25s can be OK, even very good, so again taste it to see what they are like with your machine and coffee.