I currently have my application set to run on iPad & Mac (Mac Catalyst), with my interface option set to Optimize for Mac, and am having serious difficulty updating the button padding when running on my Mac...
When I have Scaled to Match iPad selected, this is what it looks like:
When I have Optimize for Mac, it then becomes this...
Here is a quick snippet I put together to try isolating a solution. This exact snippet products the above images when toggling the Mac Catalyst Interface.
var config = button.configuration
config?.imagePadding = 20
config?.titlePadding = 20
config?.contentInsets = .init(top: 0, leading: 20, bottom: 0, trailing: 20)
button.configuration = config
button.setNeedsUpdateConfiguration()
button.updateConfiguration()


I made a quick test app and used the following button code:
This gives the following result when run on a Mac using "Scaled to Match iPad":
and the following when run on a Mac using "Optimize for Mac":
When optimized for Mac, the button ignores the content insets and the image padding leaving you with a standard Mac button look. But note that there is space between the image and the title.
Your code doesn't show all of your button setup so it isn't clear how you are getting no space between the image and title.