On some points, both the compiler and Lazarus are not fully backwards compatible.
The compiler issues are usually minor and documented in the release notes, including work-arounds tips how to modify your code.
They can have a major effect, though, if you are not aware of those changes.
Lazarus is (was) less well documented on breaking changes.
BTW: same issues exist with e.g. Delphi.
The most likely is, however, that there was already a bug in the existing code that is now revealed because of the compiler being more strict.
(e.g. less forgiving in the case of use-after-free)