The UK Government’s Border Force has apologised for its mistake, which one passenger said caused “general panic”.
It has offered full refunds to the 36 passengers involved.
Edinburgh Airport blamed inaccurate guidance from the Scottish Government for the confusion.
Passengers arriving on a Ryanair flight last Friday argued in vain with Border Force officials that they were not required to buy the home-testing kits because they had been in Ireland for more than ten days, which is part of the “common travel area" with the UK.
The airport said Scottish Government guidance had stated such travellers must take a Covid test on the second and tenth day after arrival, before being corrected to state this did not apply “if you have only travelled within the common travel area in the ten days before arriving in Scotland”.
One passenger said the incident had caused “stress, shock, and indignation”.
The St Andrews University student said: "The officers would not allow us to leave the airport without proving we had purchased a £210 at-home Covid testing package.
"I verbally confirmed with them several times that, despite having been in Ireland for more than ten days, they were requiring me to do this.
"When shown screenshots contradicting this requirement, they responded they understood there was a lot of ‘contradictory information’, but we were still required to [purchase] the package.
“When I was allowed through, the officers had their hands full with a crowd of confused and frustrated travellers.
“The officers were very respectful and polite and just trying to follow the rules, as we all were.
"But when all parties involved realised there was contradictory information, the situation should have been brought to higher authorities who could resolve the issue then and there.
"I am disappointed it happened because it was an unexpected and unavoidable expenditure that caused a general panic among travellers which should have been alleviated so much sooner than it was.”
A spokesman for Edinburgh Airport said: “This policy has been beset with issues from the very beginning due to the Scottish Government’s lack of engagement with airports and other aviation partners, and it is now passengers who are paying the price for this.
“We flagged the issue with government who admitted information on the official website was inaccurate, but the issue was further compounded when government officials wrongly told passengers to contact the airport directly when we have no role or influence in their policy.
"Again, this was raised with government and we are grateful for the apology that we received.”
The Home Office said the incident was a one-off.
Its spokesperson said: “Border Force officers mistakenly required a small number of passengers arriving into Edinburgh Airport on February 26 from Dublin to book a testing package - we apologise for this error.
“Border Force took swift action to correct the error - contacting the airline operator the same day to provide instructions on how passengers could claim a full refund and immediately briefing all officers again on how to apply the regulations correctly.”
A Scottish Government spokesperson said only: “Border Force recognised the error and quickly addressed the issue with its staff.”