Hello Antony,
Most probably there is some “insert” server action, running on page load which should not be there.
Please create a normal page (not include page or content page), and add your modal/form there so it can run normally in your browser and test again.
Perhaps the insert action is set to ‘autoload’. If so, clear the autoload checkbox. (I think it’s called ‘autoload’ - I’m not in front of a computer at the moment.)
So the Server Connect elements added to the page execute each time the page is loaded…
… so my “list_contacts” server action should be in a Server Connect element set to autoload so I see my contacts when the page loads…
… but my “add_contact” and “delete_contact” actions don’t need to be there, autoloaded or not, as they are just run each time their respective form is submitted.