Yes, an electrolyte imbalance
could in theory cause palpitations. Dr Frank had already answered your question but I just noticed your edit regarding you having Cystic Fibrosis
CF can cause Hyponatremia
(low salt levels). It's to do with the protein CFTR (Cystic Fibrosis conductance Transmembrane Regulator) which is found in the cells that line the lungs and pancreas
etc. The protein controls the movement of electrically charged particles, like sodium in and out of the cells.
If this protein is defective (which happens with CF) the salt balance in the body is disturbed. This explains your low sodium levels.