I unfortunately wasn't able to recreate the issue you speak of. I will step by step tell you what I did to see if they match what you did.
Step one is I went to the Magic HQ.
Step two is I I pressed Control + Shift + C to toggle the console on. Then I entered "testingcheats on"
You get a notice if you did it right.
Step three I entered "bb.enablefreebuild"
Again it let me know that I entered it right.
Step four was I entered build mode, clicked on the Gallery, chose lots, chose 50x40 (the lots size). searched for Magic Headquarters, chose a lot, clicked yes when it warned me it would replace the old lot and I could not undo it. And it was done.
I am sorry if I wasn't of help. I could not reproduce your issue. Try what I told you in my first post. If that don't work you may need a factory reset. I wish I could be of more help.
Sims 4 Factory Reset - (What & Howto)
https://www.carls-sims-4-guide.com/forum/index.php?topic=29292.msg401669#msg401669