Yep, that would work. A cheaper option (which I use) is to clone a SIM for iMessage (costs about $1 in total).
Here's a link to the guide I used: https://airmessage.org/help/guide/phone-number (I used method #1 with a Ting sim card from Amazon)
Sim card: https://www.amazon.com/Ting-Mobile-Card-Unlocked-Phones/dp/B08MKV5F2R/
You don't need to have any cell plan with it, just follow the guide!
Here are a few things you can do to prevent future issues: