This error is almost always caused by a missing or untrusted digital certificate, which is a key component for Windows to verify a file is safe and from Microsoft. When you create an offline layout, a folder named certificates is created within it.
For standard .NET desktop development and web development setups, restrict the layout to those specific packages: visual studio 2017 offline installer iso