If I switch a SIM card from an iPhone to an Android, then back to the same iPhone, will data be lost?
No data is lost on an iPhone when a SIM card is being removed or inserted.
The only thing to keep in mind: You might need the SIM PIN (if there is any set) to use the card in a new phone.