pixel_player60435087 The museum can be build at every free spot of your port, you just need enough free space to place it. It is not necessary to place it at the coast.
Usually you should see a building after you bought it and you should also see the space under it go green if you can place the building at the actual position or red if there is not enough space here. Once you have the building placed at a green position, you need to tap it to actually buy and place it there, everything else will cancel the buying and placement.
I just don't remember a red X at the bottom of the screen, so I think you are playing the game on a different platform than me (Android), perhaps PC. Perhaps if you tell us which platform you are trying, someone with the same platform might have an idea.