BOLT11 requires padding the signing data with zeros to a byte boundary before hashing. groups_to_bytes() instead discards or rejects the remaining bits. A separate conversion for groups[:-104] should append the padded final byte whenever bits remain.