Multiple Layers not syncing right

Greetings. I just started trying to record a tune with my keyboard and I recorded the baseline and drums first and then I let it play that back while recording the melody. During the recording the timing is dead on but once I play back the recording the timing is only in sync for about 15 seconds and then it sounds like the melody part is at a faster tempo than the baseline. What is causing this and how can I fix it?

Thanks.

Similar problem … https://forum.audacityteam.org/t/extremely-strange-problem/6369/4

However before trying new hardware I’d do everything possible to prevent skipping (many tiny missing skipped bits accumulate causing tracks to become increasingly out-of-sync as they progress), e.g. disconnect from internet when recording.