Thanks for your help.
I am happy to report that I have found the culprit. There are two more files accompany the sqlite database file. The error is gone once I have mounted the extra files inside the node-red container. In my case, they are home-assistant_v2.db-wal and home-assistant_v2.db-shm.