Background: This problem was encountered in Civ5 with GnK and BNW and all DLC, in a game created using the mod "Gibraltar, Reef, and Krakatoa Fixes (v. 101)". This mod does not affect gameplay, only map creation, and so it should be possible to load the attached saves without this mod. In any case, I do not believe that the problem I am reporting is related to this mod, or any specific DLC, or even BNW or GnK. It should be possible to reproduce on any version of Civ5.
The Problem: If the player transfers control of a city with an empty production queue to another civilization then the player will be unable to end the turn. The game will require the player to "Assign Production" to that city, but will not allow the player to do so because the player does not control the city. <shift><enter> will not force the turn to end. Saving and reloading returns the game in a bugged state. The only option for continuing the game after this happens is to reload from a previous save and avoid repeating the mistake. (Well, strictly speaking one could also regain control of the city that turn, but this is almost always going to be impossible.)
Expected Behavior: The game should only require the player to "Assign Production" to cities that the player controls. If a city awaiting a production assignment ceases to be controlled by the player, then it should no longer be necessary for the player to assign production to that city in order to advance to the next turn.
Reproduction: To reproduce the problem exactly as I encountered it, load the save
Cannot End Turn - Before Problem, contact China, and gift them the city Shanghai. (Shanghai revolted this turn. When an AI city of little strategic importance revolts, I like to annex it, sell off an expensive building, and then sell or gift it back to the original AI to help feed that AI's continued happiness problems. Because of this behavior I have encountered this bug several times.) After this action is taken it will not be possible to advance the game further.
It takes less than a minute to replicate the problem from that saved game, however the save
Cannot End Turn - After Problem is provided in the unlikely case that anyone else has trouble replicating the problem from my first save.
Alternatively, it should be possible to replicate this problem from any saved game (in which the player has at least 1 non-Capital, non-Puppet city and contact with at least one AI). To do so, arrange for the production queue of that city to be empty (by completing the current production without any other items in the queue) and then trade or gift that city to an AI without first assigning new production. Assuming I am correct, there will be no way to advance the game past that point.
Avoidance: This problem is simple to avoid, if one remembers to do so. Assigning production to the city before the player transfers control of it will avoid the problem and allow play to proceed normally. It is easy to forget to do this, at least in my case, because I typically want to deal with this foreign city before moving on to domestic concerns. The "Assign Production" request does not remind me because some of my other cities could be awaiting production assignments.
Ideally this problem should be fixed even though it can be avoided, because:
a) the fact that the problem exists constitutes a logic error in the program code, and
b) the negative impact on the player if it does occur can potentially be considerable (in the form of time and turns lost by having to fall back to an autosave).
Closing: The saves attached were too large to attach directly, so they have been compressed with 7Zip. If for some reason I am wrong and these saves cannot be loaded and the problem cannot be replicated from some other save then let me know and I will generate a smaller save to demonstrate the problem.
Edit: I swear I searched for other reports of this problem before posting this thread, and did not find any. However,
immediately after submitting this thread I saw another thread that, upon investigation, turned out to be a compliation thread of other reports of this same problem. That thread is
Can't clear select city production prompt. My searches were for "end turn" related problems; I guess I should have searched for "production queue" problems as well. My apologies for the mistake.