GDScript uses indentation. So after a function all code is indented by one tab. In the editor godot uses tabs for indentation.
But you have copied code from somewhere where spaces where used instead of tabs. (For example this Q&A)
But in my editor (3.2.3) when using spaces it autoconverts them to tabs on saving. But only with 4 spaces in a row. So mabe there are only 3 in your case or it is a setting which I enabled. The best salution is yust to delete all indentation of copied code an reindent it with tabs.