Recording through headphones and a mic always lands late — delayed by the device's round-trip audio latency.
This demo proves the fix: measure that round-trip latency with the
<latency-test> component, then shift the next recording's start by
that amount to remove the offset.
Follow the steps below in order.
Record the metronome guide track through your mic, with no compensation applied.
Listen for the late "flam" against the guide track and look at the waveform offset.
Use that track's own mute button in the playlist below so only the calibrated take plays next.
Record again — this time the measured latency shifts the take into alignment. Play it back to compare.