So I made some testing and...
Power sources:
I. 2-pin terminal (power brick with output - 24V - 1.5A = 36W, exactly the same as a delivered power supply for DC jack with the router)
II. ZyXEL GS1920-24HP PoE (802.3at compliant [power modes: legacy, 802.3af, pre-802.3at, 802.3at]) switch (50.0–57.0V - 0.6A = 34.2W capped at 30W as per PoE spec)
Scenarios:
A) Both sources connected at startup
The 2-pin terminal takes charge and PoE is never delivered (confirmed with web-management switch portal).
Aa) when PoE cable is disconnected router works as before
Ab) when the 2-pin terminal is disconnected router turns off and after 5-10 seconds it is powering up using PoE. This creates interrupted service, not HA
B) 2-pin terminal connected at startup, PoE connected later
Results are the same as A)
C) PoE connected at startup, 2-pin terminal connected later
Ca) when the 2-pin terminal is disconnected router works as before with PoE delivering power
Cb) when PoE cable is disconnected router works as before with the 2-pin terminal taking over the power supply
Cba) following Cb scenario when the 2-pin terminal is disconnected router turns off and after 5-10 seconds it is powering up using PoE. This creates interrupted service, not HA
Cbb) following Cb scenario when PoE cable is disconnected router works as before
Analysis:
PoE implementation is not good
a) as per
https://mikrotik.com/product/rb5009ug_s_in PoE is 802.3af/at but it is not working when DC input is present (802.3af/at requires negotiation with device)
b) the only way for PoE to create an HA solution is a passive PoE solution which in most cases will be idiotic as it requires either a dumb PoE switch or a PoE dumb brick power supply
Potential fix:
1. Put information about such behavior in user documentation so user will not expect HA power solution with PoE (using 802.3af/at standard) and DC (jack/2-pin terminal) in.
2. Fix behavior of the routerboard - after attaching PoE cable board negotiates power with switch. As almost always 802.3af/at switch provides higher voltage this will become the primary source of power for the board and when DC power is disconnectet router can still be up