I made a mistake but I can't find it.
Yes, that works. However, the problem statement is confusing. You wrote "[the] lengths of the diagonals of the rectangle ABCD is 10." I think what you meant is this: "The sum of the lengths of the diagonals of the quadrilateral ABCD is 10" - correct?