There are 3 options I know to avoid focus error while recomposing:
1. Focusing on a subject that is located at the same distance as your subject.
2. Moving yourself forward / backward after recomposing to compensate focus shift.
3. Using AF microadjustment (this one is tricky).
