Often you are left with the option of combining a power supply, DC electronic load, and additional hardware such as a diode. This solution is non-ideal because it is complex and often consists of a “deadband” when switching from sourcing to loading current.
https://www.youtube.com/watch?v=SaoKQYGp4eY