The first thing that comes to my mind is that you're fighting a latency issue. Which is basically a slight delay between the time you sing your note to the time you hear the note in the headphones. So if you're slightly compensating for it possibly without even realizing it, it would result in exactly what you're describing. You come in slightly ahead with your vocal to line up with the track you've already recorded, and it ends up recording slightly ahead so the timing is off.
Ways to reduce this would be to reduce your buffer size in your audio hardware (how you do that depends on your hardware, so you'll have to do your own homework on that one). You can also record dry (no plugins. reverb, EQ, etc.)
If that fails, in the editing section in your manual, you might want to read up on transient detection and editing. This will allow you to split up your recording into chunks that you can then physically move around to line up your timing with the rest of the track.
By the way, not to be too picky, but you should probably use the word track instead of layer.
In studio one, layering is a feature in its own right and is not the same as tracks so you probably don't want to get them confused.