Let's review how you set up the two Automator actions in the Automator Application. The input is a single folder, so you have to configure that in the Ask for Finder Items action:

This will ask for a single folder and the path of that folder will be passed to the Run Shell Script action that follows:

You must select the correct Shell entry and because you are passing a Folder path, the Pass input: must be as arguments.
There will be a boilerplate Ruby code loop in that action, and you will remove that, before copying/pasting the full Ruby code that I wrote into it. If you open that Ruby code in TextEdit, you will destroy the sensitive indent that is necessary for correct code execution. That is why I suggest a couple of programmer's editors in the documentation because they won't harm the code before copy/pasting into the Run Shell Script action.
Look at the extensions set in the code. There is a bug in there. The 'dng' extension should be '.dng', so it will process DNG image files. If there are any extensions missing that you require, add them in the exact lowercase syntax shown.
You can test run the Automator application before you save it to your Desktop by clicking the Run button. It will pop a dialog that you can ignore and then it will prompt you for a folder containing your images. The next thing you see will be the final tally of files, folders, and elapsed time. Your YY-mm-dd folders will contain their respective images in the designated folder.
The same code (v2.0) that I posted in 2019 runs without change on macOS 11.6.5 and with the Apple supplied Ruby v2.6.3p62. It also works with Ruby v3.1.2 that I have separately installed. It works whether you have installed the free third-party tool ExifTool in /usr/local/bin, or not.
Apple stated in the past that they planned to remove Python, Ruby, Perl, and PHP from future operating systems. With macOS 12.3.1, they have now removed PHP, and Python and only Apple knows when they will remove Ruby and Perl. As this solution depends on Ruby, it will break on the operating system release where Apple has removed Ruby, unless one installs their own current version of Ruby. I will give some thought to the practicality of rewriting this script in Zsh, which Apple has committed to as the default shell.