Batch rename files based on folder name
I’ve been using the very powerful paid app A Better Finder Rename for many years for complex file and folder renaming needs. Perhaps this app will help. I think it has a free trial period, too.

You can find it here.

Disclaimer: I’m an extremely satisfied user. No financial or other connection to PublicSpace.net.