Creating a tailored sample from panel data
Your approach seems no good. Let us make it really simple: You have only the dependent variable and you want to compare the averages across countries. You keep the firms whose $y$ values are inside the range. By doing this, you are (sort of) equating $y$ values, which you aimed to compare. This is strange. In fact, this leads to endogenous sample-selection.

It seems, however, acceptable to keep only comparable firms (rather than firm-year) based on the exogenous variables.