This can be reproduced using the attached Behat script.
(I was running it on OSX 10.10.5 / Firefox 46.0.1 / Selenium 2.53.0)
When using the behat step "And I add a "Glossary" to section "1" and I fill the form with:"
Behat inconsistently presses the "Save and Return to Course" button which will result in the behat test failing. Since it doesn't always fail (In my case it happens about 50% of the time) I suspect it is some sort of race condition.
Note: Moodle 3.0 is NOT affected.