Yeah, I'm not surprised that it's filesystem-related.
I would like to understand what happens when the repeated
lockfile_acquire: symlink /home/abuild/rpmbuild/BUILD/ccache-3.2.1/testdir.2712/.ccache/5/stats.lock: Permission denied
logs appear. The strace log you attached unfortunately doesn't seem to include information about it. Looks like you are passing "-f" to strace so that it follows forks? System calls made by other processes than ccache are not of interest for debugging this problem, I think.
So yes, if you can share more of the strace log, or do it in a more targeted way (e.g. waiting for ccache to hang and then attaching to the running process), that would helpful.
In more detail, I'm looking for syscall traces of lock creation calls, i.e. symlink(".../stats.lock", ...), when they go bad. Something about btrfs's behavior trips ccache up.