That helped. You did not answer the question about HOW you are importing images, so I'll address both options.
First, if you have the box checked for "Copy items to the Photos Library," then what happens when you import is that Photos goes to that file and imports the image into an internal database within Photos as a binary large object (BLOB) and gives it the random alphanumeric name you see in the screenshot you provided. Photoslibrary is a SQLite database, in part, and it stores the exif data in separate tables from the BLOB table, then has additional tables to track each change that is made to the original image. At that import time, the data that is on line 2 is set, as that is the source file for all the BLOB, exif, and edit data. That is the default way of importing.
But, if you don't have the box checked for copying items, then what Photos does is to note the full path name to that image and stores that data in the internal database, but NOT the image itself. Same long alphanumeric string to point to the original filename. In addition, it stores the entire pathname to the file so that it can retrieve the file the next time you open Photos. Photos depends on the user leaving the file EXACTLY in the same place if it isn't copied into the internal database, and if the user changes anything in that full path, Photos will simply say the file is missing and it cannot open it. Basically, the BLOB part isn't stored, so it has to be exactly where it was recorded at the time of the import.
In both cases, what is on line 2 is fixed at that time. It is, AFAIK, unchangeable.
It's a bit like my wife being asked for her birth certificate. It shows her maiden name. But her legal name now is different, since she took my name when we got married. So her name now is not what is on the birth certificate because she chose to change her name. But she cannot get a copy of her birth certificate with her married name because that was not her name when she was born. Can't change history. Same with that filename. That is what you imported. Can't change history. You CAN change the Title, which is the first line in your screenshot. And you then can use the Title for things like sorts, printing, whatever. Just like my wife has a passport with her new name, and a driver's license, etc. But the name of the file you imported, on the second line, is the name you imported. It was the "birth name" of the image. You can change the name when you EXPORT the image back to a straight file, but you cannot change what you imported. Again, history.
Ok, back to the two cases. In the first case, if you really, really, really want change the names, you will have to go back to the original import process and change the name of the file BEFORE you import them. Doing that renaming/reimporting will mean that you will have a lot of work.
If the original files are no longer available, you will have to export all of them from Photos, edit the filenames using Finder (or Terminal, or AppleScript, it doesn't matter) to whatever you want them to be, then create a new photos library and import them all new. At that point all edits you have made to the images will be lost, because the edits are also stored in Photos in the database and reapplied each time you open the image. And before you ask, no, you cannot export, rename, import to the SAME Photos database and have Photos reapply the edits for you. Can't change history that way. Note that Photos will allow you to save the ORIGINAL file because it knows what that file is, and it has kept it in the database, or you can export the changed file but then Photos won't have the record of edits on the new imported file because the new imported file hasn't been edited by Photos. And you can make the filename of the new image be the TITLE instead of the Filename in the export dialog, so you could make the title changes in Photos, export the images using Titles for filenames, then import them into a new photos library and the data on line 2 will now be what the Title was in the original Photos database. But, the edits are gone. Can't get around that. It's much like the relationship of my wife's birth certificate and wedding license. One shows what she was at birth, the other shows the change from old to new name. If she could convince the state to make the change on the birth certificate to show her married name, the marriage license would be invalid because it shows her birth name. Can't change history. Given how Photos operates, if the original filename changes, the links to the BLOB, or the external file that wasn't copied in, is broken.
If the original files are available, and you want to do this, you don't have to export from Photos, you can just change the actual filenames of the files and import them into a new Photos library. Works out the same, edits are lost, etc.
In either case, once you have the files imported with the new names and you know everything is OK, you can delete the OLD Photos library to make space available again from that drive.
If, on the other hand, the box is NOT checked to copy in the images as BLOBs, then what Photos does is to reconstruct the exact path to the original file, but it then stores the edits to that original in the Photos database and reapplies them each time you open the image. Note, the original file is NOT changed by the edits, it is still the original file. But the edits to that file are stored and applied, and if you EXPORT that edited image you get a new file with the edits applied and the history lost for that file. (In this case there is no point in exporting the original file, it was never actually imported.) And, critically, if you change the location OR NAME of that file using Finder, Terminal, AppleScript or anything else, then Photos will not be able to find that image file because the path to the file will be pointing to what was imported, not what you renamed the file. Again, you will have to re-import the renamed file, and the old edits to the old name file will be lost.
Bottom line: AFAIK, Line 2 cannot be changed once created. Title (first line) can. Date (third line) can. But not line 2. It's the "maiden" name at birth and is fixed in history. I don't know why AppleScript is reporting the name is changed when it is not. Might be a bug in AppleScript, or your script, but the filename is unchangeable.
I'm 99.9% sure of what I have described. I don't know all of the internals of HOW Photos tracks everything, the library is an SQLite database with all kinds of tables for edits, files, blobs, thumbnails, etc., and I don't have the schema for the database and just don't want to spend the time or effort to try to sort it out. So, someone may come along and have a magic trick that will do the transformation you want, but I seriously doubt it.
My vote would be to leave Line 2 alone, too much work to export, reimport, re-edit. Just live with it.
Hope that helps. I know it isn't what you wanted to hear.