if you can’t meet the financial requirements in 5 years, I think it’s safe to assume that you wouldn’t be able to renew. But if you know that ahead of time, you could organize yourself so that you are ready to apply for a different type of retirement visa.
you can apply from within or from outside, as you wish. Once approved, you will be asked whether you want to receive your passport stamp in Bangkok, or at your nearest Thai embassy.