To clarify.
Change 1, e.g. Commit 1:
Change to LF
Change 2: Code-change.
2: Code-Change
1: Change to LF
0: Current main
It needs to be done in two separate changes. A single change will not suffice.
The code-change needs to be on top of the change to LF.
We had this issue on our 3.6.1 instance as well, and this is how we fixed it,
However, I currently can't reproduce the binary file issue. So I can't find a way to showcase the fix.
Unfortunately I don't have any other ideas on how to resolve it if it does not work for you.