From what I see, you’ve got a repeating problem. What happens is that you get the last ID and then add 1. However, the last ID is a string (which is your problem). It gets further complicated by the fact that you are now adding 1 to a string and I suspect that somehow this causes the code to keep the ID as a string, and then saves the new ID as a string as well.
You should fix the database so that each item (row) in the database has a number for the _ID field. That will change the result of getting the last ID which should then be returned as a number. And, this will hopefully result in the new ID, that is being created from the last ID, being a number.
In short, it’s a self perpetuating problem. Fix the database, make sure your code correctly handles number and strings, and you should end up with proper number IDs.