go database / sql lastinsertid返回奇怪的值

I've got a big list of records (~21k) that I'm sending to a mysql database.

Now in order to optimise the process, every 500 documents I'm doing a request:

for k, record := range records {
    ...
    sqlStatement = "INSERT INTO ..."
    if k%500 == 0 {
        stmt, err := db.Prepare(sqlStatement)
        if err != nil {
            log.Println(err)
        }
        res, err := stmt.Exec(valuesArgs...)
        if err != nil {
            log.Println(err)
        }
        fmt.Println(res.LastInsertId()) //Print 19895
    }
}

Once I finish to loop over my records I still do one more insert in case we don't have a multiple of 500 at the end of the loop:

...
stmt, err := db.Prepare(sqlStatement)
if err != nil {
    log.Println(err)
}
res, err := stmt.Exec(valuesArgs...)
if err != nil {
    log.Println(err)
}
fmt.Println(res.LastInsertId()) // print 20394

And I'm quite surprised to see that it's showing an id of 20394, but in the DB the maximum id is 20741.

Between the id within the for last loop and the id after it, there is a difference of 499.

This I tried to put the smtc within a structure and close it after the loop / before last call, but no, it changed nothing!

Any idea why the last id isn't the last one inserted (20741)?