The above solution by @mmonline seems like it would do the trick, but it is overly complicated in my opinion.
All you really need to do is get all files, build a loop that iterates through those files, find the target folder for each specific file and move the file.
Here's a sample of such flow, which is much more simple:

Here's a snippet you can copy and paste directly into your PAD designer to have the actions automatically created for you:
Folder.GetFiles Folder: $'''C:\\RPA\\Input''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
LOOP FOREACH File IN Files
Folder.GetSubfolders Folder: $'''C:\\RPA\\Output''' FolderFilter: $'''*-%File.NameWithoutExtension%''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Subfolders=> Folders
File.Move Files: File Destination: Folders[0] IfFileExists: File.IfExists.DoNothing MovedFiles=> MovedFiles
END
Note you will need to change the directories from "C:\RPA\Input" to your actual directory where the files are stored and from "C:\RPA\Output" to the directory with the sub-folders.
Please note the caveats regarding file naming that were mentioned by @mmonline do apply here, too.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution.
If you like my response, please give it a Thumbs Up.
If you are interested in Power Automate, you might want to follow me on LinkedIn at https://www.linkedin.com/in/agnius-bartninkas/