Recently i did a SharePoint migration from 2010 to 2016. We used the detach and attached method. So our method was to migrate from 2010 to 2013 and then to 2016. The migration has been completed but some sites are encountering some web part error as shown below. Hoping i can get some advice for it.
Please try with opening the visual webpart in Visual Studio and reload the assemblies once again and deploy it once again. This error is common and is because of mismatching assemblies.
However, as you mentioned you are doing a direct content DB migration, so you could either retract the .wsp solution of the webpart, and then install it back again. After this perform an IIS Reset. This should solve the issue.
If the issue still persists, you can manually override the web.config files and manipulate the in tags. This blog explains the same.
Hope this helps!