This resolved the issue for me.
Suggest instead to use a more generic command that would apply to all users and does not contain the user in the path.
rm ~/Library/Containers/com.apple.Safari/Data/Library/Saved\ Application\ State/com.apple.Safari.savedState/windows.plist