rich2005, your comments really saved me!
The problem was indeed that I installed the snap version of Gimp. So, I completely removed Gimp, and then I installed Gimp 2.10.18 via ppa:otto-kesselgulasch/gimp. Afterwards, I moved my script into ~/.config/GIMP/2.10/scripts, and it worked fine either via command line or via GIMP!! I will try to run my actual scripts now, and then, if everything fine, I will mark the thread closed.
I am so thankful for your messages!
Issue solved It can be marked as closed
The problem was indeed that I installed the snap version of Gimp. So, I completely removed Gimp, and then I installed Gimp 2.10.18 via ppa:otto-kesselgulasch/gimp. Afterwards, I moved my script into ~/.config/GIMP/2.10/scripts, and it worked fine either via command line or via GIMP!! I will try to run my actual scripts now, and then, if everything fine, I will mark the thread closed.
I am so thankful for your messages!
Issue solved It can be marked as closed