There are a million small embedded systems that are designed for that application and aren’t made to the lowest possible standard that they could muster. And those have RTOS on bare metal. The Pi is a fat and slow computer.
You can take upstream kernel and u-boot and tf-a, just build it, flash it and have a working system for 10s of different boards from various manufacturers.