Suppose $L$ is a field and $R$ is an $L$-algebra which is an integral domain. Let $K$ be the fraction field of $R$ and suppose that $A$ is also an $L$-algebra.
Let $M$ be a module over $A\otimes_L R$ which is free as an $R$-module and such that $M\otimes K$ is free over $A\otimes_L K = (A\otimes_L R) \otimes_R K$. Must $M$ be a free over $A$? If not, what is the obstruction? What if I say ''flat'' instead of free?