From some correspondence I had early in the year. Alas only partly documented. In the end part of the issue was that the ticketed name and the two FF programs had different initials on file. As well I found a partner FF special to earn the 5K miles I wanted on the second program.
This probably happens because when you add a QFF number on the QF site, it adds it without a segment association which means it applies to all flights on that PNR. When they add your other FF number, the system most likely adds it as a segment associated entry (associated to that specific flight). Therefore that's why you'll see both.
For you to picture what happens, this is likely what it looks like in a PNR, after the lounge has changed the FF number:
SSR FQTV QF HK/ QFxxxxxxx
SSR FQTV QF HK/ AAxxxxxxx/S3
Where the first SSR is the 'all flights' FF number and the second SSR is the specific flight associated one. S3 being the flight it applies to.
You could probably get around this issue by having your QFF number specifically assigned to each and every flight so that there's no "all flights" FF number SSR in the PNR. The QF site won't let you do this however. You'd need to call up.
Example:
SSR FQTV QF HK/ QFxxxxxxx/S2
SSR FQTV QF HK/ QFxxxxxxx/S3 (changing this to AA when appropriate) SSR FQTV QF HK/ QFxxxxxxx/S4 SSR FQTV QF HK/ QFxxxxxxx/S5
Hope that helps with the wandering
Fred