Does noodling negatively affect playing?

Hi all. When practicing I usually play slower than whatever speed I’m trying to get to until I can play comfortably at that speed, wether it’s a song, riff, etc. This is of course to avoid making too many mistakes in practice and eventually play whatever it is cleanly.

Although at times I noodle on the guitar and when I do this I’m normally playing the stuff I’m learning, or stuff I haven’t quite mastered yet, carelessly, and normally at whatever speed and sometimes (a lot of the time) with mistakes.

So the question is - does this mindless noodling of things I’m trying to learn negatively affect playing or possibly cancel out the slower methodical practice and I should avoid it, or noodle in a “better” way?

Thanks!