I have a python toolbox with a parameter set up like:
lyrInput <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Parameter<SPAN class="punctuation token">(</SPAN>name <SPAN class="operator token">=</SPAN> <SPAN class="string token">"lyrInput"</SPAN><SPAN class="punctuation token">,</SPAN>
displayName<SPAN class="operator token">=</SPAN><SPAN class="string token">"Input Feature Layer"</SPAN><SPAN class="punctuation token">,</SPAN>
direction<SPAN class="operator token">=</SPAN><SPAN class="string token">"Input"</SPAN><SPAN class="punctuation token">,</SPAN>
datatype<SPAN class="operator token">=</SPAN><SPAN class="string token">"GPFeatureLayer"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="comment token">#changed to allow drop-down from open layers</SPAN>
parameterType<SPAN class="operator token">=</SPAN><SPAN class="string token">"Required"</SPAN><SPAN class="punctuation token">)</SPAN>
lyrInput<SPAN class="punctuation token">.</SPAN>filter<SPAN class="punctuation token">.</SPAN>list <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">"Polyline"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>When I open the tool in ArcMap 10.5.1, it shows me the layers that have been added to ArcMap:

However, when I open it on our virtual servers using ArcMap 10.7.1, the filter doesn't show any layers added to ArcMap. This means that selections won't be applied:

It's the exact same python script on both versions. But, in 10.7.1, nothing shows. I've tried creating a separate script and setting the filter in the properties and, when no filter is added, it shows me in_memory layers but when I set a filter to the feature layer, it doesn't show anything.
Any ideas?
UPDATE: I just noticed that my trying to add the newly created layer to ArcMap is not working. It's giving an error stating, "CreateObject cannot open map document"