Welcome Hugo, and I am sorry to hear about your situation.
During your test ride, do you recall whether you rode at sustained RPMs above 4,000? If not, the FI light might not have come on. Usually, a knock sensor code of 25 or 26 is a sign that the PGM-FI unit has gone bad, but not always. I hate to disparage someone I do not know, but this seller may have knowingly failed to disclose this problem. When my ECM went bad, the unit would reset each time I turned off the ignition. If the code has been stored in the ECM (i.e., the FI light flashes without the engine running), then it could mean that something else is causing the problem.
In some cases, owners have found the wiring from the knock sensor to the ECM had shorted, and in others, the ECM threw codes because of low battery voltage. There are about a half-dozen diagnostics you can do to verify whether you have an ECM failure. However, if the FI light comes on when you maintain sustained RPM's above 4,000 for ten or more seconds, then it's likely you have a bad ECM. In my case, I had three options: keep riding it as is, replace the ECM, or part it out. However, replacement ECMs are difficult to find because Honda has discontinued their production for model years 2003-2007.
Whether the bike is safe to ride with a bad ECM has been the subject of much discussion on this forum. Two of the most knowledgeable members,
@Igofar and
@aniwack , do not agree on this matter. Some owners have been riding their STs with bad ECMs for years and claim not to notice any problems other than a significant drop in fuel mileage. Other owners have reported that the bike runs hotter than usual, which has resulted in melted wiring and fairings. As for myself, I found a seller in Japan that had a NOS ECM for the US Police STs that will work on my '05 ST13 and had it imported to the States. Because some of the European models have HISS, I cannot say whether this is an option for your Pan.
I sincerely hope your problem is not a faulty ECM. My failure happened at around 92,000 miles (140,000 Km), but I have seen reports where failures have occurred with fewer miles (Kms) like your bike. Why does this problem happen? No one is quite certain. Nevertheless, the ST is not the only Honda model to experience ECM failures. Hopefully, you can find a solution.
Chris