How to increase the size of the system partition (container) on Catalina?
If you shrunk the second (visible) partition to create free space. The free space is directly below this partition. You can not add this space to the APFS container, because the free space is not adjacent to the APFS container. In other words, the partition with the HFS volume is between the APFS container and the free space. This prevents adding the free space to the APFS container.

One possible solution would be the following.


Move all the files from the HFS volume to an external drive.
Convert the partition containing the HFS volume to free space.
Add all the free space to the APFS container.
Shrink the APFS container and add a new HFS volume.
Move the files from the external drive to the HFS volume.


Another possibly better solution would be to replace partition with the HFS volume with a new APFS volume inside the existing APFS container. The steps are given below.


Move all the files from the HFS volume to an external drive.
Convert the partition containing the HFS volume to free space.
Add all the free space to the APFS container.
Add a new APFS volume to the APFS container.
Move the files from the external drive to the new APFS volume.


The external drive would not have to be a HDD or SSD. You could use a 256 GB flash drive (or maybe a smaller flash drive).