Look deeper and diagnose where you are off timing-wise. Learn the art of self-correction... your teacher can only point the way, you have to discover it yourself.
do you speed up? When/where in the song? Slow it right down to better understand the distance between notes.
Rush the fun riffs? Incorporate expression (accents, staccato, etc) & make each note more interesting.
Syncopation not as tight as it should be? Count more subdivisions in your head, metronomes are great for teaching you to hear this.
That riff you recorded
- slow the beat down to half that speed
- set 16ths subdivisions.
- Learn to hear & feel the note length, and the rests between the notes you play.
- DON'T increase tempo until you've nailed it perfectly, and
- don't increase tempo anymore than 5bpm when you do, otherwise old habits kick in too quickly.
Relax, be patient with yourself, trust that it will all come together and be easy once the penny drops.