Question asks "I want to query the OS version from T-SQL". This does NOT specify Windows - Linux is also an OS. sys.dm_os_windows_info is available only on Windows, according to...
Has it been installed by some other application, maybe? You can package it as a pre-requisite. If so, I expect you'd need to either uninstall or modify the other application.