I think the only way to make it work would be:
1) Insert into the database without setting the file name column
2) Upload the file and give it the correct name
3) Update the database with the filename
So just add a second Update server behavior to your second scenario to get the final file name and don't even try to set it in the insert.