It appears that the issue is related to the SQLITE database, I used a different file, and script worked as expected.