I tried recreating your issue and just like what @Knut Olav Løite mentioned, you are inserting two rows with the same Id value. You can try using batch.insert_or_update instead of batch.insert only. However, take note that this will update the row that has the same Id
</body></html>