A friend's family flew into a EU country with a letter, they thought this letter was their visa but it turned out to be a rejection from the EU country's consulate (maybe it was a request for more information for their visa application). They were denied entry, but there was no indefinite detention, they were just told to get on the next plane out of the country and had to wait in the "international area" of the airport until said flight.
And as you describe in the EU it's "up to 24 hours". And in the lawless authoritarian regime? That Canadian girl was detained for 11 days and was told to prepare to be held for months: https://www.cbc.ca/news/canada/british-columbia/jasmine-moon...
A friend's family flew into a EU country with a letter, they thought this letter was their visa but it turned out to be a rejection from the EU country's consulate (maybe it was a request for more information for their visa application). They were denied entry, but there was no indefinite detention, they were just told to get on the next plane out of the country and had to wait in the "international area" of the airport until said flight.