Yes the scenario you note is common, but not unexpected.
I will expand on what you wrote based on my experience so that others may have more information to help them.
When first learning Prolog it is easier to write all of the code in one file.
Then as one progresses, to start using modules, but only existing modules in libraries and use the use_module/1 directive. However if the module is from a library it will most likely be free of bugs/errors so when the primary source file is loaded with consult, the library modules loaded with use_module/1 will not report an error.
Then one begins to create their own modules and loads them using use_module/1. Now upon the first load of the primary file with consult the other modules are loaded and any errors are reported in both the primary file and modules. If a change is made to one of the module files loaded using use_module and then only consult is used, the fixed source code in the module loaded using use_module will not be loaded and the error will still exist. Through trial and error one discovers, as you noted, that if they shut down the top level and restart and then do the consult, the corrected code loaded via use_module is loaded and the error is no longer present.
However because I use SWI-Prolog with Windows I have come to find that using the menu option
Reload modified files will also reload any modules modified and loaded using use_module, even if they are nested a few layers down.
I didn’t know about make/0 and have never used make/0 but will start to learn to use it now.
The other nice thing about using
Reload modified files is that if you are using the guitracer,
you don’t have to run
gtrace to reload a change, e.g.
the files will be reloaded and the guitracer left ready to accept another query.