I also faced this issue and the workaround i found was to copy the modules needed from where they are installed to the path indicated in the PSModulePath for the user used by ssm document.
See where module is installed
Get-Module -ListAvailable -Name "{module_name}" | Select-Object Name, Version, Path
See the value for PSModulePath
Write-Output $Env:PSModulePath
Copy the module for the installed path to the PSModulePath
Copy-Item -Path "{installed_path}" -Destination "{ps_module_path}" -Recurse