Packaging fails if game module is included into plugin module

As in the topic. I included my game module into my Plugin.Build.cs in order to use some functions that exist in game module. It works good, the problem is that when I package it for windows x64 it failswith unkonown error. Nothing helpful is there. I had to remove my game module from plugin build file in order to package. Why is that?

By definition a plugin can’t have a dependency on a game module, otherwise it’s not a plugin.
You need to move the shared functionality out into the plugin, or a new plugin; or move the plugin code that is dependent on it back into a game module.