I confirm that the issue exists,
and that the proposed patch addresses it.
As many tools like GNOME's file-roller and MATE's engrama call p7zip,
this issue is very important, and tens of bug reports have been filed
over the years in various applications and bug trackers about it.
This patch will indirectly solve all of them.
Upstream p7zip hasn't been active in recent years,
but the proposed patch has already been accepted in szcnick's p7zip more
actively maintained fork:
https://github.com/szcnick/p7zip/commit/e56ea97d89eb0cd59603402496a8208238b3fda2
It'd be great if we had this included in bullseye.