I am reporting a workaround in case anyone has a similar issue:
The issue is that when refreshing both the master and the details grids simultaneously, the details grid goes blank for the selected master row. The only way to correct the problem is to refresh the gird or the page manually.
Similar issues were reported in the following posts:
https://forums.oracle.com/ords/apexds/post/master-detail-interactive-grid-refresh-detail-grid-0942
https://forums.oracle.com/ords/apexds/post/ig-master-detail-refresh-both-grids-7167
The workaround is to register dynamic action (refresh) for both grids separately - one for master grid and one for child grid. Refreshing both grids in a single dynamic action does not seem to work well.