Looking at afw.image.TanWcs.cc, we see that the TanSip decoding is ignoring the first terms of the A and B polynomials (constant and linear terms). At first look, this is logical because these terms are supposed to be in the CD matrix and the CRPIX, but the simultaneous astrometry is fitting general polynomials without assuming the SIP representation. Converting from these polynomials to a standard SIP is not trivial and lead to numerical instabilities unless we use the linear and constant terms.
Apparently other SIP decoding implementations like : wcstools-3.9.1/libwcs/wcssubs-3.9.1/distort.c are not ignoring the first SIP terms.
Looking at the document describing the SIP convention it is not specified that these terms should be explicitly ignored and they should be taken into account for the reverse transformation (AP / BP).
So the question is : “should we modify TanWcs.cc to take into account the linear and constant terms of the TanSip if they are non zero” ? The change is trivial : just changing the lower bound of the loop index.