I have solved the problem myself and I am sharing my solution with you (very kind isn't it?).
Your version OS_Gallery_package_pro_5_1_2020_03_02.zip cannot handle parameters that contain the apostrophe character (ascii #39 printed as ' ). I expect that there are also other characters that will throw an error.
Some European languages use these special characters very often (for example English and French).
Anyway, the apostrophe in the gallery name was causing the error!
Your database code is somewhat 'messy' and also contains a SECURITY RISK, because you are not escaping the DB query string! This makes the code prone to SQL injection.
The problem was in the file
lines 1094 and 1095
The lines read:
1094: $query = "INSERT INTO #__os_gallery(title, published, params)"
1095: ."(backslash)n VALUES('".$oldGalData->title.'(COPY)'."','".$oldGalData->published."','".$oldGalData->params"' )";
FIX: use the Joomla! core function $db->escape()
this will escape the query string.
> instead of $oldGalData->title you must use $db->escape($oldGalData->title)
> instead of $oldGalData->published you must use $db->escape($oldGalData->published)
> instead of $oldGalData->params you must use $db->escape($oldGalData-> params)
> you should NOT use the 'new line' character (backslash)n and you should code the whole $query assignment in one line OR do it properly with adding to the variable in the next line like '$query .= ......'.
WARNING: There are more instances in your code where you are writing to the DB and fail to make the query SQL SAFE. You should check all the 'INSERT INTO' and 'UPDATE #__' instances.
Please note that I only checked the above mentioned file. You should review ALL your code.
My problem is now solved!
At your service and kind regards.