Do I lose data when canceling iCloud plan
No. Your data won't be deleted automatically when you downgrade your plan. You'd be given a grace period to download your data. Also, the storage decrease takes effect after your current monthly or annual subscription ends.
If you have more data than the space available in your iCloud storage, the excess data won't sync to the iCloud servers and you'd be alerted that you are out of space.