I use Whonix to perform OSINT on the Tor network via OnionSearch, Onioff, etc.
I have connection problems when using these tools. For example for OnionSearch, I get:
OnionSearch also queries for Onionland, the execution bar increases to a certain percentage, then it stops and shows the connection error above, it's as if the connection is unstable! Very weird
Then, for Onioff, I have the error message : Unsuccessful Tor connection
However, I do have access, via the Tor browser, to the onion links, and the Tor service is also working correctly.
Does anyone have an idea where the problem could come from or rather in what should I dig to seek the resolution?

I had the same issue. I resolved the problem by changing a couple lines in the python script onioff.py in the root install folder.
at line 59
and the same thing at line 84
Also you may need to delete the last line if it is empty.
to
Save it and try to execute it. Should work