I tried this one and it works fine.
You wrote files in folder source_folder but it should be folders in folder source_folder
set source_folder to alias ("/Users/ronny/Desktop/" as POSIX file)
tell application "Finder"
set numberOfFiles to count of (folders in folder source_folder)
end tell