Hap ax S ether 2 to 5 not working with some device

On the hAP Ax S ether1 is different from ports 2-5 because it is the only port that connects "directly" to the CPU (while the other 4 ports go through the Switch chip):

This points to some incompatibility between Switch chip (and/or bridge settings) and that particular device.

Actually - if the device has a slowish connection (100 Mbit/s) it is not at all a bad idea to have it connected to ether1, have the port into the bridge as LAN together with ether2-4 and configure ether5 self-standing as WAN, this is due to some issues of the Mikrotik (or Mediatek) drivers, if you search on the forum you will find how many people are using this setup to have full internet speed.

Even if definitely counterintuitive and "wrong" (in theory) such a configuration usually guarantees (in practice) better/faster throughput for the internet connection on this specific device model (hopefully things will change for the better in newer RoS releases).

As a general rule of the thumb, when a connection doesn't work but it suddenly start working if you interpose a (dumb) switch it means that the issue is insomething that even a dumb switch modifies, this points to either link speed/protocol negotiation or traffic issues, like bursts (that the switch might cache) or MTU or similar settings (that the switch might "level").
In your case it is more probable that it is the first, but cannot really say.
What is "strange" in your report is that the thingy seemingly does not work with static IP's on both sides (static IP's usually always work, while when there are DHCP negotiations/address assignment there could be incompatibilities).

Also, even if I don't believe it, voodoo is sometimes a thing. :astonished_face:
I have a PC (regular, desktop) with a 1 Gb network card, that cannot (doesn't want to) connect at 100 mbps to a (no-name) dumb network switch (which is 100 mbps) and continuously flaps connected/not connected/100mbps/1Gbps), but if I make the connection go through two ports of a hAP lite (that I have nearby and that is used normally to give wifi connection to another device) everything starts working by sheer magic.