The primary cause of this issue is that Microsoft does not want anyone to programmatically automate this feature and they have even deprecated it in the latest operating systems beginning with Windows 8.1. It may even be totally deprecated in Windows 10. So, there is a limitation on the operating systems this setting may be applied to.
When trying to Pin a Shortcut on a Windows 8.1 or higher OS, the sltrace shows:
Warning on Windows 8.1 and above pinning/unpinning shortcuts are not fully supported.
Pin items that are not in the System32 folder.
It may also be possible to use the slpinshortcut function to work around these issue.