It’s my headcanon that The Doctor knew he was a fictional character before Lux, that episode just confirmed it.