Cannot change anything inside a folder, however it's not Locked and I have all the rights
UPDATE 2 (now I got it):
The culprit is the ACLs. Apparently Time Machine uses them, and copying via Finder preserves ACLs.
They are easy to remove recursively from folders where you know they are not needed:
sudo chmod -R -N ~/Pictures for example will drop all ACL rules in ~/Pictures and everything inside.
Source/more info: https://backdrift.org/fixing-mac-osx-file-permissions-and-acls-from-the-command-line
older unsuccessful attempts:
After some more desperate searching and brainstorming, I came up with one workaround:
1: Install coreutils from Homebrew (if not already done so)
2: gcp -dRl &lt;broken_folder&gt; &lt;temporary_folder&gt; — this will &quot;copy&quot; it with hardlinks instead of actual copying while not preserving permissions and any other &quot;invisible&quot; things which could be broken, so it's fast and almost zero damage regardless of file sizes
3: Test if permissions in temporary folder are OK &quot;in practice&quot;
4: sudo rm -rf &lt;broken_folder&gt; &amp;&amp; mv &lt;temporary_folder&gt; &lt;broken_folder&gt; — remove bad one and put fixed one in its place
based on this answer and GNU cp manual.
UPDATE:
In newer versions of macOS even this doesn't work. Looks like they are actively trying to make me switch to another OS.