Thanks for your query.
Some pain after knee replacement
is not uncommon. pain when walking after sitting or lying occurs due to some muscle spasm. Doing stretching exercises will be helpful to relieve the spasm. If it persists consult your doctor.
I do hope that you have found something helpful and I will be glad to answer any further query.