I did some debugging and found out that Flag0 is set ON in both routes ("defend" and "attack") after beating the boss. Removing the "ShiftFlagOn(A)=0" line at
x1218y1032 in the
World.ini file fixes the incorrect ending scene issue.
I experienced this bug in my playthrough, but I didn't even realize this wasn't the correct sequence. In fact, I thought the boss being there watching you at the end of the good ending was intentional, as if it was some sort of cliffhanger hinting at a possible sequel