After playing around with some of properties of panel , the issue was resolved.
Issue in my case :
First panel had property layout: 'anchor'
Second Panel had property layout: 'border '
Changed the second panel property layout: 'anchor'
This might not be your case . This error is very generic and can pop up due to multiple reasons .