I have recently studied scattering theory on a formal level and I think I understand the subject quite well by now. However what I often struggle with is to translate the abstract identities into explicit representations and solve problems with it. I have condensed this issue down to the following example problem, which requires a little bit of algebra but is rather instructive in my opinion. I have provided most of the formulae already, there is probably a conceptual mistake somewhere though.
Consider the one-dimensional Schrödinger equation $$\left(-\frac{1}{2}\frac{d^2}{dx^2} + V(x)\right)\psi(x) = E\psi(x)$$ with the finite square well potential that is terminated by an infinite barrier on one side
$$ V(x) = \begin{cases} \infty, & \text{for } x \leq -L \\ V_0, & \text{for } -L \leq x \leq 0 \\ 0, & \text{for } 0 \leq x. \end{cases}$$ For simplicity assume $V_0<0$.
One set of scattering states for this problem is easily found as $$\psi^{(+)}(E,x) = \frac{1}{\sqrt{2\pi}}\begin{cases} \frac{I(E)\beta}{\alpha}\sin\left(\alpha(1+\frac{x}{L})\right), & \text{for } -L \leq x \leq 0 \\ e^{-i\sqrt{2E}x} + S(k) e^{i\sqrt{2E}x}, & \text{for } 0 \leq x. \end{cases}$$ Here, $S(k)$ is the scattering matrix (just a number since there is only the reflection channel here) $$S(E)=-\frac{\alpha\cot(\alpha) + i\beta}{\alpha \cot(\alpha) - i\beta}$$ and the remaining coefficients are $$I(E) = - \frac{2i\alpha}{\alpha \cos(\alpha) - i\beta \sin(\alpha)},$$ $$\alpha = \sqrt{\beta^2-2V_0L^2},$$ $$\beta = L \sqrt{2E}.$$
So far so good. Now from formal scattering theory we know that there is also a T-matrix defined by (see e.g. Eq. (7.40) in Newton's book (available on Springer Link)) $$T(E) = \langle\psi_0(E)|V|\psi^{(+)}(E)\rangle.$$
Importantly, the T-matrix is related to the scattering matrix, which in the single channel case takes the simple form (see Eq. (7.58) in Newton's book) $$S(E) = 1 - 2\pi i T(E).$$
Here, $\psi_0$ is an eigenstate of the free Hamiltonian (i.e. with $V=0$), in our example with the boundary condition at $x=-L$ we get $$\psi_0(E,x)=\sqrt{\frac{2}{\pi}}\sin\left(\beta(1+\frac{x}{L})\right).$$
Now for our example the overlap integral for the T-matrix can be evaluated in the position representation $$T(E) = V_0 \int_{-L}^{0} dx \psi_0(E,x) \psi^{(+)}(E,x)$$ and we can plug in our formulae for that. However when substituting the result into the relation to the scattering matrix, it does not hold. I have checked this using Mathematica and manual calculation.
I am clearly doing something wrong. But what? My suspicion is that I have plugged in the wrong states, but I don't know what the right ones are.
EDIT: Following the discussion with TwoBs, here is some more insight on which states should be used. As far as I understand $\psi_0(E,x)$ can just to be an eigenstate of the free Hamiltonian; $\psi^{(+)}(E,x)$ is an eigenstate of the full Hamiltonian but also defined uniquely by the Lippmann-Schwinger equation: $$|\psi^{(+)}(E)\rangle = |\psi_0(E)\rangle + G^{(+)}(E) V |\psi^{(+)}(E)\rangle,$$ with $G^{(+)}(E) = \frac{1}{E-H_0 + i0^+}$.
The explicit formula I gave for $|\psi^{(+)}(E)\rangle$ above was just some eigenstate of the full Hamiltonian, so the mistake is probably that it does not fulfill the Lippmann-Schwinger equation with the $|\psi_0(E)\rangle$ I used. But which state does?