Data distribution impacts the performance and generalisability of contrastive learning-based foundation models of electrocardiograms