I suspect that your plan is not viable, but details might depend on your country of citizenship and the various other countries involved.
You left you country of origin, A, and traveled to B as a tourist or whatever. B decided to let you in according to their rules.
From B you traveled to C. You had a visa or the possibility of visa-free entry in C. Typically, the airline wanted to see such documents from you before they allow you to board. Immigration officers in C usually wanted to see proof of onwards travel and means of subsistence.
...
- Now you are in country X. You have had visa-free entry or a visa, and you have convinced the immigration officials of your means of subsistence and onwards travel -- possibly by showing them a ticket some months later to Y.
- At the end of your allowed stay in X, go to the airport, showing the airline the documents which will let you enter Y, and you get transported to Y. You should have proof of onward travel prepared, to some country Z, and you should have enough funds for your means of subsistence if you hope to be allowed into Y.
- Y refuses you entry and you do not claim asylum. (Actually, the rules might be so that you can not claim asylum airside. Rules have become a lot tougher in recent decades.) What Y should do is to make the airline take you back to X, at your expense (and last-minute tickets are very expensive).
At this point you are in an administrative system which assumes you are an irregular immigrant and (usually) tries to prevent your acceptance as a refugee. Most countries want wealthy tourists and business travelers, and skilled immigrants, but not irregular immigrants.
- Z will take notice that Y refused you entry and might not let you in, either. Also, Z would likely want to see proof of onward travel, and that might not be arranged yet.
- Y might refuse to hear your asylum application (and all the rights which come with it) because you were safe in X.
- X might refuse to hear your asylum application because you have left and are now airside.
A lot depends on just which countries A, X, Y, and Z are. If A and Z are part of the European Union, likely all would be fine. Officials in Y would note that you have a right to enter Z, and let you travel there.