I would never attempt to use a CSV file as an input table. There are just too many things to go wrong with the schema. Invalid fields names, incorrect guesses of fields types and null values. There are clearly differences when using the interactive interface in ArcMap, it must do a bit more validation such as checking for indexes.
The first thing is to define a schema for the CSV using the Microsoft schema.ini definition. This helps the software stop having to guess the format of the CSV. Then it will load the rows into a nicely defined table with valid field names, instead of all numbers being floats and all strings being 255 characters.
Next, copy the temporary virtual "CSV-table" into a Real Database table, such as a file geodatabase using CopyRows, something that can have a primary unique indexed key. Your join key can also be indexed and validated. For example if it is supposed to be an integer, if the field is defined as a float the join will not work.
Now your JoinField tool has a chance of working.