I know this is an old post but it pops up in google searches so....
Palpitations during fasting can happen for a variety of reasons.
Due to gas in the digestive system.... once this happened to me but not during fasting. The easy way to verify is to lie down and they will pass. Sit up and they return. It's that simple.
Lie down, if they don't pass then it's not due to the digestive system.
Other reasons are magnesium deficiency, electrolyte imbalance, sudden intake of sugars or lack of sugars as mentioned in this thread. Maybe others?