Tried removing the AppleScript components from this, and using bash or zsh directly? Add some echo commands to see the values in the symbols being used; ugly-debugging. You’re most of the way there to the shell already, of course. See if the code without Automator involved works.
If you want to create this parsing yourself, IFS is one of the most common ways, though it’ll hit issues because CSV is a simple-looking, but… less than robust… file format. I’d consider a library for parsing the CSV file too, as embedded spaces and other characters can derail the rename. (What VikingOSX posted is immune to most of those messes, though is sensitive to extra or escaped commas.)
Preference-wise, I’d probably use “${1}” and “${2}” here and not shift, too. shift is an ugly hack that works around some really old argument-parsing limits when 10 or more arguments are needed. Using “${1}” and “${2}” are clearer.
One of the more common requirements for these sorts of questions is creating your own file or photo storage database, and that gets gnarly for other reasons. If that’s what you are more generally doing here, moving to a database and away from Numbers or Excel, and avoiding CSV more generally, and utilizing Exif as appropriate, can be a more robust approach.
When I get back to the Mac, I’ll post up some code.