I've been fighting with a problem where I could not package one of my tools as a geoprocessing package. After lots of trial and error I found that it was connected to a totally innocuous try/except in my code. When the try/except is in the code (see below - for illustration purposes only), the publishing fails with an error message that provides no clue. I noticed at some point that if I highlight the problem tool in the Catalog then click Properties -> Parameters I get this message

When I remove the try/except, I can view the properties OK, and more importantly the publish works. I'm not a python expert so maybe there is a good explanation about how a try statement like that could have such a side effect - I'd love to hear it.
For my tool I was able to do some recoding and get around the problem. But if you are having trouble with publishing, perhaps a good test is to make sure the tools parameters are viewable via the tool properties.
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">class</SPAN> <SPAN class="token class-name">Toolbox</SPAN><SPAN class="punctuation token">(</SPAN>object<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">__init__</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
self<SPAN class="punctuation token">.</SPAN>label <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Toolbox"</SPAN>
self<SPAN class="punctuation token">.</SPAN>alias <SPAN class="operator token">=</SPAN> <SPAN class="string token">""</SPAN>
self<SPAN class="punctuation token">.</SPAN>tools <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN>TestBoolean<SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">class</SPAN> <SPAN class="token class-name">TestBoolean</SPAN><SPAN class="punctuation token">(</SPAN>object<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">__init__</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
self<SPAN class="punctuation token">.</SPAN>label <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Tool"</SPAN>
self<SPAN class="punctuation token">.</SPAN>description <SPAN class="operator token">=</SPAN> <SPAN class="string token">""</SPAN>
self<SPAN class="punctuation token">.</SPAN>canRunInBackground <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">False</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">getParameterInfo</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
layer <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Parameter<SPAN class="punctuation token">(</SPAN>displayName<SPAN class="operator token">=</SPAN><SPAN class="string token">"Feature Layer"</SPAN><SPAN class="punctuation token">,</SPAN>
name<SPAN class="operator token">=</SPAN><SPAN class="string token">"layer"</SPAN><SPAN class="punctuation token">,</SPAN>
datatype<SPAN class="operator token">=</SPAN><SPAN class="string token">"GPFeatureLayer"</SPAN><SPAN class="punctuation token">,</SPAN>
parameterType<SPAN class="operator token">=</SPAN><SPAN class="string token">"Required"</SPAN><SPAN class="punctuation token">,</SPAN>
direction<SPAN class="operator token">=</SPAN><SPAN class="string token">"Input"</SPAN><SPAN class="punctuation token">)</SPAN>
checkbox <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Parameter<SPAN class="punctuation token">(</SPAN>displayName<SPAN class="operator token">=</SPAN><SPAN class="string token">"Checkbox"</SPAN><SPAN class="punctuation token">,</SPAN>
name<SPAN class="operator token">=</SPAN><SPAN class="string token">"checkbox"</SPAN><SPAN class="punctuation token">,</SPAN>
datatype<SPAN class="operator token">=</SPAN><SPAN class="string token">"GPBoolean"</SPAN><SPAN class="punctuation token">,</SPAN>
parameterType<SPAN class="operator token">=</SPAN><SPAN class="string token">"Required"</SPAN><SPAN class="punctuation token">,</SPAN>
direction<SPAN class="operator token">=</SPAN><SPAN class="string token">"Input"</SPAN><SPAN class="punctuation token">)</SPAN>
checkbox<SPAN class="punctuation token">.</SPAN>value <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">False</SPAN>
params <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN>layer<SPAN class="punctuation token">,</SPAN> checkbox<SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">for</SPAN> param <SPAN class="keyword token">in</SPAN> params<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">try</SPAN><SPAN class="punctuation token">:</SPAN>
filter_list <SPAN class="operator token">=</SPAN> str<SPAN class="punctuation token">(</SPAN>param<SPAN class="punctuation token">.</SPAN>filter<SPAN class="punctuation token">.</SPAN>list<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">except</SPAN> Exception<SPAN class="punctuation token">:</SPAN>
filter_list <SPAN class="operator token">=</SPAN> <SPAN class="string token">'Can not access'</SPAN>
<SPAN class="keyword token">return</SPAN> params
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">isLicensed</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">return</SPAN> <SPAN class="token boolean">True</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">updateParameters</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> parameters<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">return</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">updateMessages</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> parameters<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">return</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">execute</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> parameters<SPAN class="punctuation token">,</SPAN> messages<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">return</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>I'm running this on ArcPro 2.4.3 and Python 3.6.8 and Advanced license.