** I have done a search to the best of my ability and couldn't find much info on this topic. If this has been discussed before, please point me to the respective thread rather than berating me for creating a double. Thank you

**
I am a BA Gold/Emerald and an AA Platinum/Sapphire member.
On 2 separate occasions I have asked at the gate of the BA flight, for my FF number to be swapped from the BA number to the AA number.
On both occasions my request was met without issues and I have also received a new Boarding Pass with the AA number, however a few days after the flights the points/miles/Avios were credited to my BA account regardless.
This always resulted in endless discussions with the BAEC callcenter to take those flights in question off of my BA account (up to 2 weeks) and then having to retroactively claim the miles with AAdvantage (which usually takes around 6-10 days).
I would like to know when the last opportunity is to change the FF number for a BA flight, for it to be credited to the according FF account.
Is it:
1- Before check-in with BA (ie. call reservations and change from BA to AA number, or vice versa, as there is no option to change FF card in MMB - obv. safest option but least preferred)
2- During counter check-in (in this case check in at the airport without having done online-check-in, as again there is no option to change the number on BA's website during online check)
3- At the counter before passing security, however with online-check-in completed
4- After check in but before flight close (ie. before reaching the gate, for example at lounge reception upon leaving the lounge)
5- At the gate before or after boarding (obviously didn't work for me)
Does anyone have concrete insight into this?
Guesses are fine but I would prefer an actual information/experience, as the BAEC call center agents could not give me an answer as they do not work with Altea's FLY DCS system.
For reference, all airlines working with the LH DCS system (LH/OS/LO for example) as well as UA's and AC's DCS: Once the flight has closed (all pax boarded) the list with FF numbers is sent for automatic processing, which again is obvs. not the case with BA.
Thank you in advance!