Bebop 2 compass orientation wrong

I have a Parrot Bebop 2 running Copter v3.4.6 (binary from here). I loaded the Bebop parameters in Mission planner and got a wildly spinning copter. It turned out that the direction of rotation of the motors was wrong (it switched between Bebop 1 and Bebop 2, compare e.g. photo Bebop 1 to photo Bebop 2). Switching the frame type from “X” to “H” cured this problem.
During flight, the quad was oscillating continuously, so I tuned the Rate Roll and Rate Pitch P and D values.
Now I am struggling with the compass. After a first crash into a tree I noticed that the compass direction is 90° off: if the copter points southwards, the HUD in Mission Planner indicates westwards orientation. Normally, setting the COMPASS_ORIENT parameter should fix this, but this parameter has no effect on my Bebop 2. As far as I can see, the orientation is hardcoded for the Bebops (line 37 in AP_Compass.h). My current workaround is to turn automatic determination of declination off (COMPASS_AUTODEC=0) and to set the declination to -90° (COMPASS_DEC=-1.571).
A first test indicates that this workaround makes loiter work ok, but I wonder if it is completely equivalent to COMPASS_ORIENT (apart from the 3° real declination here at Jena that I am ignoring with the current setting) or if it will bring me into trouble in future flights?

Edit: The log from the most recent flight can be downloaded here. Opening it in Mission Planner and choosing the “Sensors/Compass/Compass vs Yaw” view makes me wonder if the workaround is really working, as I see a 90° offset between Compass and Yaw. On the other hand, it was loitering for two minutes without major problems. But there is also the compass error at the beginning of the flight… Any thoughts?

Here is another log from a flight today: 2017-11-30 15-05-10.bin (944.4 KB)

This time I had the “Learn offsets automatically” box on the compass setup page ticked (although I have done a manual calibration). The comparison between compass heading and yaw looks strange to me:

Most of the time, compass heading and yaw are offset by roughly 90°, but what is happening around line 8500 or between 10500 and 11000?