Can I max out my cash isa but later withdraw 4000 pounds to put in a lifetime isa writhing the same financial year?
You would not be able to do this. The flexibility rules require you to put the money back into the ISA account from which it is withdrawn.
Additionally the money must be added back into the account within the same tax year to remain flexible.
Technically… it doesn’t change the fact that you used the threshold. It only means you are borrowings nd paying pack to it.