"Take an untwisted rectangular wing planform, so the span-wise lift distribution is definitely not elliptical."
No, but nor is it linear across the span - downwash affects the distribution, and the lift is biased towards the inboard sections. Don't try to get too deep into this: if you want to do it fully you will end up with pages of highly complex equations, and probably wish you had not started.