Pins 2 and 3 are i2c. Thats a shared bus that can be used by multiple devices, as long as no two devices have the same i2c address. The button shim uses 0x3f and the Witty Pi uses ox68 so thats not a problem.
Pins 2 and 4 are physically tied together so it doesn’t matter which one you use. They both have the same +5V source. Multiple devices can be connected to the +5V, +3.3V and Ground pins. As long as you don’t draw too much current, 1.2 A is I believe the limit set by the poly fuse.
Don’t confuse the physical pin numbers with the BCM numbers.
BCM 17 is physical pin 11. Pin 11 isn’t used by the Button shim.
BCM 4 is physical pin 7. Pin 7 also isn’t used by the Button Shim.
Any of the +5V, +3.3V or Ground pins being shared isn’t an issue
I don’t see any conflicts, Pin wise.
Why you got error’s with the python code, I don’t know?