Cannot resize APFS partition - "The new size must be different than the existing size"
For me it looks like you need to resize the container first. So something like 

$ diskutil apfs resizeContainer /dev/disk0s3 500g


should help to avoid the error message you get on your second try.

I've got not much knowledge about the diskutil, but as far as I know Apple software overall, this seems to be the step you are missing here.