When iCloud Photos are turned on there are only a few reasons it would keep 20gb of photos on the iPhone.
1. You have "Download and Keep Originals" turned on instead of "Optimize iPhone Storage". This is found in Settings > Photos.
2. You recently looked through a lot of photos and video and the full res versions were downloaded to the iPhone. If that is the case they will eventually disappear from the device.
3. You have A LOT of available free storage on the iPhone. Since its much more efficient for iOS to do nothing unless there is a reason (ie not a lot of free storage) iOS just hold onto photos. To optimize storage iOS needs to verify the photo integrity, construct a low res version for your iPhone, issue a delete command for the space (NAND storage can't be over written it needs to be deleted before the space can be used), cause wear and tear on the NAND (it has a finite life), perform garbage collection to optimize the space, all while using data, battery life and computation power. Then you look at the full res version two days from now and it redownloads them the very thing it deleted. Using more network data, writing the same data back to the storage, etc etc. All to arbitrarily free up storage space that wasn't needed. 20gb seems like a lot so that is unlikely the case (assuming you dont have 100gb free).
4. You don't have enough iCloud space (20gb of data wont fit into a 5gb hole).
Google Photos is preferred method for a lot of people. Deleting the photos (high/low res version) from the Photos app deletes them from iCloud. I would recommend having a physical and accessible back up before doing anything, Then you'll just need to upload the photos to Google (Google offers 15gb of storage for free, if you have 20gb of photos you'll need to upgrade for 1.99 a month). Once they are uploaded and verified you can delete them from the photo all.
If it is a situation that you do have a lot of free space there is a chance even after you manually delete the photos it space will become cached data for a while. Again, if iOS can use space you are using to enhance performance by reducing overhead it will.