There's some inconsistency in how the bits are numbered.
In the Inspector, the left-most bit is numbered 1. In the method call set_collision_mask_bit(), that same bit is 0. In either case, that's the LSB (least significant bit) of the integer mask.
It doesn't matter which numbering scheme you use, so long as you're consistent about it.
If you set the bits numbered 1 and 4 in the Inspector, that's equivalent to doing it in code by:
# Set bits 0 and 3. Leave other bits unchanged.
set_collision_mask_bit(0, true)
set_collision_mask_bit(3, true)
or:
# Set whole mask to specified value.
collision_mask = 1 + 8
or:
collision_mask = 9
or:
collision_mask = 0b1001 # binary