When flashing my first costum rom to my phone, I was super hyped and didn't do a backup of the stock rom, because I knew no reason for switching back. But recently I discovered this cool tool scat which allows you to inspect the gsm traffic of your phone. To start reading your gsm traffic, you must switch your USB port to a diagnostic mode, which is only possible via dialing a code in the stock rom phone app.
When searching for samsung stock firmware online, you find all these dubious sites, where you don't have a good feeling download software from them. But then I discovered, that there are some tools to download the stock firmware from samsung directly. I used samloader which has a little bit of a strange cli interface. Downloading the newest stock rom for my Samsung Galaxy S5 mini (sm-g800f) worked liked this:
samloader -m SM-G800F -r DBT checkupdate
samloader -m SM-G800F -r DBT download -v G800FXXU1CVG5/G800FDBT1CVG4/G800FXXU1CTK1/G800FXXU1CVG5 -O .
samloader -m SM-G800F -r DBT decrypt -v G800FXXU1CVG5/G800FDBT1CVG4/G800FXXU1CTK1/G800FXXU1CVG5 -V 4 -i SM-G800F_1_20220804094531_fztatv01nn_fac.zip.enc4 -o SM-G800F_1_20220804094531_fztatv01nn_fac.zip