WP_Editor – Setting render location on page

As kaiser has stated, you are attempting to return the the markup for an instance of the WP Editor, but you’re using wp_editor() – a function that echos its output.

From the
source it
is absolutely clearly stated that this method renders the editor. You
need to call it exactly where you want it.

error code: 523